Re: [Module::Build] ask() and you will receive
Status: Beta
Brought to you by:
kwilliams
From: David W. <da...@ki...> - 2006-04-11 14:40:23
|
On Apr 11, 2006, at 02:23, Randy W. Sims wrote: > The only bad thing is open ended questions get a little more > verbose. Instead of: > > $answer = Prompter->ask( > prompt => "What is your user name?\n", > default => 'guest', > ); > > You would have to say: > > $answer = Prompter->ask( > prompt => "What is your user name?\n", > options => ['/guest/'], > default => 'guest', > ); That seems silly. Why force them to use options if it's open-ended? > Another options would be to require the user to flag the default if > it is not in the options list. In effect, the user must declare she > knows the string entered is not in the options and that she knows > exactly what she's doing. Yeah, that'd be okay. > $answer = Prompter->ask( > prompt => "What is your user name?\n", > default => '!guest', > ); > > (The first character of the default string is an exclamation mark.) Why use a mini-language? Why not just another parameter? yes_i_know_default_isnt_in_options => 1, ? Best, David |