Prompt
NAME
IO::Prompt -- Interactive validating terminal prompt
VERSION
This document describes IO::Prompt version 0.0
SYNOPSIS
use IO::Prompt;
my $n = ask('How many bananas?',7);
say "You said $n bananas";
See example.p6 and lib/IO/Prompt.rakumod for more examples of usage.
DESCRIPTION
This is a generic module for interactive prompting from the console. You can install it with zef:
$ zef install IO::Prompt
FUNCTIONAL INTERFACE
The functional interface is exported by default.
=over 4
ask
asker
=back
METHODS
=over 4
ask
ask_yn
ask_int
ask_num
ask_str
=back
PRIVATE METHODS AND ATTRIBUTES
All user IO is done tru these methods. You can override these methods to create a testable version of the module.
=over 4
do_prompt
do_say
=back
The default options can be set in the object constructor.
=over 4
message
default
type
=back
CLASS ATTRIBUTES
You can override these attributes to create a localization for this module.
=over 4
lang_prompt_Yn
lang_prompt_yN
lang_prompt_yn
lang_prompt_yn_retry
lang_prompt_match_y
lang_prompt_match_n
lang_prompt_int
lang_prompt_int_retry
lang_prompt_num
lang_prompt_num_retry
lang_prompt_str
lang_prompt_str_retry
=back
CONFIGURATION AND ENVIRONMENT
IO::Prompt requires no configuration files or environment variables.
DEPENDENCIES
Requires no external modules. Tested and built with Rakudo Perl 6, revision 38379 built on parrot 1.1.0-devel.
AUTHOR
Panu Ervamaa < <[email protected]> >
LICENCE AND COPYRIGHT
Copyright (c) 2009, Panu Ervamaa < <[email protected]> >
.
All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Rakudo Perl 6 itself.
DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.