http://www.perlmonks.org?node_id=69947


in reply to How can I validate user input?

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"; } }