Module::TestConfig::Question - question interface
use Module::TestConfig::Question; my $question = Module::TestConfig::Question->new( name => 'toes', msg => 'How many toes do you have?', def => 10, opts => { noecho => 0, validate => { ... }, skip => sub { ... }, } );
Args: See "SYNOPSIS"
Returns: an object
Required. The question we ask of a user. A string. Tends to look best when there's a '?' or a ':' on the end.
Args: a question to ask the user
Returns: that question
The name an answer is saved as. Basically a hash key.
Args: the question's name
Returns: that name
A question's default answer.
Args: a default
Returns: that default
See "skip()", "validate()" and "noecho()".
Args: A hash or hashref of options.
Returns: the hashref in scalar context, a hash in list context.
Criteria used to skip the current question. Either a scalar or a coderef. If either evalutes to true, the current question ought to be skipped.
Args: a scalar or coderef
Returns: the current scalar or coderef
Args to be passed directly to Params::Validate::validate() or another validation subroutine.
Args: a hashref by default
Returns: the current hashref
Do we echo the user's typing?
Args: 1 or 0
Returns: the current value
Joshua Keroes <jkeroes@eli.net>
Copyright 2003 by Joshua Keroes <jkeroes@eli.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module::TestConfig
To install Module::TestConfig, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::TestConfig
CPAN shell
perl -MCPAN -e shell install Module::TestConfig
For more information on module installation, please visit the detailed CPAN module installation guide.