Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: comparison of character

by davido (Archbishop)
on Jul 16, 2013 at 15:57 UTC ( #1044630=note: print w/replies, xml ) Need Help??


in reply to comparison of character

If it's homework, by all means, figure out the logic. If not:

use IO::Prompt::Hooked; my $choice = prompt( message => 'Do you wish to update? (Y/N):', validate => qr/^[YN]$/i, );

Or if you want to provide extra help upon receiving invalid input:

my $choice = prompt( message => 'Do you wish to update? (Y/N):', validate => qr/^[YN]$/i, error => "Response must be 'Y' or 'N'.\n\n", );

...or if you want to add a default...

my $choice = prompt( message => 'Do you wish to update? (Y/N):', default => 'N', validate => qr/^[YN]$/i, error => "Response must be 'Y' or 'N'.\n\n", );

Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044630]
help
Chatterbox?
[Mr. Muskrat]: Oh that is odd. I got the message that it was reparented but yeah, it didn't actually do it. lol
[Corion]: LanX: No, Co-Rion appears as Monkey God :-)
[Corion]: Mr. Muskrat: Yeah, that message is automatic when the "normal" reparenting is done, but I think some rows that make up the node were not added to the DB properly

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (14)
As of 2017-01-19 16:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (170 votes). Check out past polls.