Re: [Module::Build] ask() and you will receive
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <ke...@ma...> - 2006-04-18 21:33:40
|
On Apr 18, 2006, at 3:33 PM, John Peacock wrote: > If M::B can know whether it is executing in mode #3, then the code > can differentiate between #2 and #3 already. What is the use case > for a default value being something other than one of the prompted > values if not to determine whether the script is unmanned or the > user wants the code to make it's best guess (which should be the > same thing)? One use case is when there's really no finite set of permissible values. For example: prompt("What username should I use?", $ENV{USER}); prompt("Generate how many fropps per second?", 80); prompt("Where is libfoo.a?", '/usr/lib'); Perhaps all three of those would benefit from a validation callback, though. > That's the leap I'm not making. If the author set a default value > that represents a "best guess" option that is different than one of > the manually typed options, why does there need to be a flag that > indicates that this is a valid value too. A simple comparison > between the members of @options and $default already indicates that > something else is going on. On the one hand, the author might typo the default and not realize it, and the explicit flag helps protect them against that. On the other hand, they could accidentally typo the name of the flag too, but at least theoretically we could detect that. -Ken |