Re: asking for y or n

2004-12-15 Thread Chap Harrison
Check out recipe 12.22 from the Perl Cookbook, called "pmdesc". It should also be available for download from O'Reilly and other places. Also look into the CPANPLUS module from cpan. Thanks, Jay. pmdesc isn't pretty, but it gives the answers. :-) Chap -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: asking for y or n

2004-12-15 Thread Jay
On Wed, 15 Dec 2004 11:57:32 -0600, Chap Harrison <[EMAIL PROTECTED]> wrote: > On Dec 15, 2004, at 10:30 AM, Jay wrote: > > you can also use the cpan shell or perl -MCPAN > > to get information on installed modules, > > Is there a command to the cpan interface will produce a list of all > install

Re: asking for y or n

2004-12-15 Thread Chap Harrison
On Dec 15, 2004, at 10:30 AM, Jay wrote: you can also use the cpan shell or perl -MCPAN to get information on installed modules, Is there a command to the cpan interface will produce a list of all installed modules? Neither the 'h' command nor 'perldoc cpan' indicate anything, that I can see.

Re: asking for y or n

2004-12-15 Thread Chris Devers
On Tue, 14 Dec 2004, Christopher Spears wrote: > Thanks for the answer Chris! Now my question is how > do I find out if it is actually on my machine! It won't be -- this is a young module and not (yet) distributed with Perl. You can get it from CPAN, but if you're trying to avoid external mod

Re: asking for y or n

2004-12-15 Thread Jay
On Tue, 14 Dec 2004 17:00:44 -0800 (PST), Christopher Spears <[EMAIL PROTECTED]> wrote: > Thanks for the answer Chris! Now my question is how > do I find out if it is actually on my machine! I > don't want to have to download anything because I am > writing this script on one machine and then I a

Re: asking for y or n

2004-12-14 Thread Christopher Spears
Thanks for the answer Chris! Now my question is how do I find out if it is actually on my machine! I don't want to have to download anything because I am writing this script on one machine and then I am going to send it to another to be used. perl -v yields: This is perl, v5.8.1-RC3 built for d

Re: asking for y or n

2004-12-14 Thread Chris Devers
On Tue, 14 Dec 2004, Christopher Spears wrote: > I'm writing a Perl script where I ask the user a > question similar to: > > Would you like to remove this file? > Type y or n. Try Damian Conway's IO::Prompt: Use it like thi

Re: asking for y or n

2004-12-14 Thread Kirk Bauer
On Tue, 14 Dec 2004, Christopher Spears wrote: > I'm writing a Perl script where I ask the user a > question similar to: > > Would you like to remove this file? > Type y or n. > > How do I get Perl to receive the answer and act on it? > I've been looking in some of my books and noticed > two ways

Re: asking for y or n

2004-12-14 Thread Prasanna Kothari
#Warningt untested my $answer = ; chomp($answer); if($answer =~ m/^[y|Y]es$/) { print "Yes"; }elsif ( $answer =~m/^[n|N]o$/ { print "no"; }else { print "undefined value"; } Christopher Spears wrote: I'm writing a Perl script where I ask the user a question similar to: Would you like to r

asking for y or n

2004-12-14 Thread Christopher Spears
I'm writing a Perl script where I ask the user a question similar to: Would you like to remove this file? Type y or n. How do I get Perl to receive the answer and act on it? I've been looking in some of my books and noticed two ways of receiving input and <>. What is the difference between th