Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanks in advance, Bill Hoefermy $LENGTH = 0; while (1) { print "Enter the length!"; "\n"; chomp ($LENGTH = <>); # checking for non-numeric characters if ($LENGTH =~ /\D/){ print "\nPlease enter a number\n"; next; } last if 0 <= $LENGTH and $LENGTH <= 99.99; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Verifying number input
by footpad (Abbot) on Dec 08, 2001 at 08:28 UTC | |
|
Re: Verifying number input
by japhy (Canon) on Dec 08, 2001 at 06:42 UTC | |
|
Re: Verifying number input
by rob_au (Abbot) on Dec 08, 2001 at 15:49 UTC | |
|
Re: Verifying number input
by dvergin (Monsignor) on Dec 08, 2001 at 09:00 UTC | |
by coolmichael (Deacon) on Dec 08, 2001 at 12:08 UTC |