... 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"; ...
In reply to Re: force user to only enter numbers
by Anonymous Monk
in thread force user to only enter numbers
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |