Buckaroo Buddha has asked for the wisdom of the Perl Monks concerning the following question:
I've tried:
This seems to me like a pretty straight forward problem. What am i doing wrong? ... I can't seem to figure this out.$start = $ARGV[0]; if ($start eq '') { $start = &get_start_level; } sub get_start_level { print "Please Enter the Start-Level (0-7,?)[0]: "; $input = <>; # clear all but numbers or '?' #if ($input ne '?') { # $input =~ tr/!(0-9)//\d; #} if ($input eq '?') { print " **** internally coded help information **** \n"; print " **** internally coded help information **** \n"; $input = &get_start_level; } elsif (($input < 0) || ($input > 7)) { print "please enter a number that is between Zero and Seven\n"; $input = &get_start_level; } return ($input); } =========================== end code ============
Originally posted as a Categorized Question.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How can I validate user input?
by ton (Friar) on Apr 05, 2001 at 03:56 UTC | |
Re: how do i work this
by Russ (Deacon) on May 12, 2000 at 06:17 UTC |
Back to
Seekers of Perl Wisdom