Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Answer: How can I validate user input?

by ton (Friar)
on Apr 05, 2001 at 03:56 UTC ( #69947=categorized answer: print w/replies, xml ) Need Help??

Q&A > input and output > How can I validate user input? - Answer 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"; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
Jar. Jar!...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2017-04-25 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (449 votes). Check out past polls.