in reply to force user to only enter numbers
... print "enter a number" my $num = <STDIN> unless ($num =~/[0-9]+/){ print "this is not a number\n please type a number" } print "your number is $num"; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: force user to only enter numbers
by pvaldes (Chaplain) on Sep 02, 2011 at 16:13 UTC | |
by pvaldes (Chaplain) on Sep 02, 2011 at 16:48 UTC | |
by adroit (Initiate) on Sep 02, 2011 at 16:36 UTC |