On Tue, Dec 15, 2009 at 8:50 AM, M W487 <[email protected]> wrote:
> I do not understand what you mean by "First of all, use prompt()" ---
> is that function supplied by some module like "use IO::prompt;" ?
>
> Where can I find documentation for prompt() ?
It's provided by both ExtUtils::MakeMaker and by Module::Build
use ExtUtils::MakeMaker;
my $answer = prompt("Pick a number",42); # 42 is the default
Module::Build does it the OO way, so it can be subclassed:
use Module::Build;
my $answer = Module::Build->prompt("Pick a number",42);
The important part is that prompt() won't prompt and will just use the
default if $ENV{PERL_MM_USE_DEFAULT} is true or if STDIN is empty.
Smoke testers generally set the PERL_MM_USE_DEFAULT to true.
-- David