Sisyphus repository
Last update: 2018-01-22 22:06:14 +0300 | SRPMs: 18247 | Sign in or Sign up
en ru uk br
ALT Linux repositories
hide window
Sisyphus: 0.004014-alt1
p8: 0.004014-alt1

Other repositories
hide window
CPAN: 0.004014

Group :: Development/Perl
Source RPM: perl-IO-Prompter

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR (0/0)   Repocop 

Current version: 0.004014-alt1
Built: about 2 years ago
Size: 49.8 KB
Repocop status: ok

Home page:

License: perl
Summary: 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(' 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 `<>'.

Current maintainer: Igor Vlasenko

List of contributors: ACL: List of rpms provided by this srpm:
  • perl-IO-Prompter
Recent changes (last three changelog entries):

2015-11-27 Igor Vlasenko <viy at> 0.004014-alt1

    - automated CPAN update

2015-10-11 Igor Vlasenko <viy at> 0.004013-alt1

    - automated CPAN update

2015-02-11 Igor Vlasenko <viy at> 0.004012-alt1

    - automated CPAN update

© 2009–2018 Igor Zubkov