Package perl-IO-Prompter: Information

    Source package: perl-IO-Prompter
    Version: 0.004015-alt1
    Build time:  Dec 14, 2018, 10:42 AM in the task #217767
    Category: Development/Perl
    Report package bug
    License: perl
    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 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 `<>'.

    List of rpms provided by this srpm:
    perl-IO-Prompter (noarch)

    Maintainer: Igor Vlasenko

    List of contributors:
    Igor Vlasenko

      1. perl(Scalar/Util.pm)
      2. perl(Symbol.pm)
      3. perl(Test/More.pm)
      4. perl(diagnostics.pm)
      5. perl-devel
      6. perl-podlators
      7. rpm-build-perl
      8. perl(Contextual/Return.pm)
      9. perl(ExtUtils/MakeMaker.pm)

    Last changed


    Dec. 13, 2018 Igor Vlasenko 0.004015-alt1
    - automated CPAN update
    Nov. 27, 2015 Igor Vlasenko 0.004014-alt1
    - automated CPAN update
    Oct. 11, 2015 Igor Vlasenko 0.004013-alt1
    - automated CPAN update