Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Answer: How can I validate user input?

( #69947=categorized answer: print w/ replies, xml ) Need Help??

Q&A > input and output > How can I validate user input? contributed by ton

while ($start !~ /^[0-7]$/) { print "Please Enter the Start-Level (0-7,?)[0]: "; $start = <STDIN>; chomp $start; if ($start eq '?') { print "Some help info.\n"; } }

Comment on Answer: How can I validate user input?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (13)
As of 2014-07-31 18:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (250 votes), past polls