On Sun, Aug 18, 2002 at 06:48:24PM -0700, chromatic wrote:
> Here's a rough cut at documentation for the hitherto rumored prompt() 
> function.  Suggestions welcome.

Something like so.

--- MakeMaker.pm        18 Jul 2002 17:46:50 -0000      1.64
+++ MakeMaker.pm        21 Aug 2002 05:39:38 -0000
@@ -2224,9 +2224,34 @@
 dependency in a CPAN::Bundle, but the functionality is supported by
 different means on the current architecture).
 
+=head2 Other Handy Functions
+
+=over 4
+
+=item prompt
+
+    my $value = prompt($message);
+    my $value = prompt($message, $default);
+
+The C<prompt()> function provides an easy way to request user input
+used to write a makefile.  It displays the $message as a prompt for
+input.  If a $default is provided it will be used as a default.  The
+function returns the $value selected by the user.
+
+If C<prompt()> detects that it is not running in interactively (say,
+if it is running from a CPAN shell), or if the PERL_MM_USE_DEFAULT
+environment variable is set to true, the $default will be used without
+prompting.  This prevents automated processes from blocking on user
+input.
+
+If no $default is provided an empty string will be used instead.
+
+=back



-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
Tasty, yet morally ambiguous.

Reply via email to