Re: [Module::Build] ask() and you will receive
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <ke...@ma...> - 2006-04-10 04:08:39
|
I think this is a decent direction. I only have a couple of concerns: one, I do think that the default needs to be one of the options in an option list, or else people are just going to make too many mistakes. Two, maybe we can come up with a better name, just because I don't like classes that end in "er". -Ken On Apr 8, 2006, at 5:32 AM, Randy W. Sims wrote: > Attached is version of the ask() routine discussed earlier to > supersede or augment prompt() and y_n(), including pod. I extracted > it directly out of my working copy of MB and put it in its own > package to make it easier to demo for feedback. It would go in MB > along with prompt() and y_n() if we decide to use it. > > Here is a sample driver: > > use Prompter; > > my $answer; > $answer = Prompter->ask( > prompt => "What is your favorite programming language?\n", > options => [qw(Perl Ruby Lua Python C C++)], > default => 'unknown', > show_options => 1, > show_default => 0, > ); > > print "Answer: $answer\n"; > > __END__ > > Please see `perldoc Prompter.pm` for docs. > > Randy. > > <Prompter.pm> |