Name : perl-IO-Prompter
| |
Version : 0.004015
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 1.36
| Date : 2023-06-07 18:34:03
|
Group : Development/Libraries/Perl
| Source RPM : perl-IO-Prompter-0.004015-1.36.src.rpm
|
Size : 0.14 MB
| |
Packager : (none)
| |
Summary : Prompt for input, read it, clean it, return it
|
Description :
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 \"Summary of options\" and \"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 AATTdata = ( prompt(\' Name:\'), prompt(\' Age:\'), prompt(\'Score:\'), );
my AATTdata = ( scalar prompt(\' Name:\'), scalar prompt(\' Age:\'), scalar prompt(\'Score:\'), );
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 \"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 \'< >\'.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-I/openSUSE_Tumbleweed/noarch |