Репозиторий Sisyphus
Последнее обновление: 18 июля 2018 | Пакетов: 18627 | Посещений: 11896989
en ru br
Репозитории ALT

Группа :: Разработка/Perl
Пакет: perl-IO-Prompter

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Текущая версия: 0.004014-alt1
Время сборки: 27 ноября 2015, 12:24 ( 137.8 недели назад )
Размер архива: 49.75 Kb

Домашняя страница:   http://search.cpan.org/dist/IO-Prompter/

Лицензия: perl
О пакете: Prompt for input, read it, clean it, return it.
Описание:

IO::Prompter exports a single subroutine, `prompt', that prints a.prompt (but only if the program's selected input and output streams are
connected to a terminal), then reads some input, then chomps it, and
finally returns an object representing that text.

The `prompt()' subroutine expects zero-or-more arguments.

Any argument that starts with a hyphen (`-') is treated as a named
option (many of which require an associated value, that may be passed as
the next argument). See the section on "Summary of options" and the section on "Options reference" for details of the available options.

Any other argument that is a string is treated as (part of) the prompt
to be displayed. All such arguments are concatenated together before the
prompt is issued. If no prompt string is provided, the string
`'> '' is used instead.

Normally, when `prompt()' is called in either list or scalar context,
it returns an opaque object that autoconverts to a string. In scalar
boolean contexts this return object evaluates true if the input
operation succeeded. In list contexts, if the input operation fails
`prompt()' returns an empty list instead of a return object. This
allows failures in list context to behave correctly (i.e. be false).

If you particularly need a list-context call to `prompt()' to always
return a value (i.e. even on failure), prefix the call with `scalar':

   
   
   my @data = (
       prompt('Name:'),
       prompt(' Age:'),
       prompt(' Sex:'),
   );

   
   
   my @data = (
       scalar prompt('Name:'),
       scalar prompt(' Age:'),
       scalar prompt(' Sex:'),
   );

In void contexts, `prompt()' still requests input, but also issues a
warning about the general uselessness of performing an I/O operation
whose results are then immediately thrown away.
See the section on "Useful useless uses of `prompt()'" for an exception to this.

The `prompt()' function also sets `$_' if it is called in a boolean
context but its return value is not assigned to a variable. Hence, it is
designed to be a drop-in replacement for `readline' or `<>'.

Текущий майнтейнер: Igor Vlasenko

Список всех майнтейнеров, принимавших участие
в данной и/или предыдущих сборках пакета:

Список rpm-пакетов, предоставляемый данным srpm-пакетом:

  • perl-IO-Prompter
ACL:
     
    дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
    текущий майнтейнер: Michael Shigorin