$input_var = 0 ; # to get the loop executed at least once while( ($input_var < 1) && ($input_var > 10) ) { print "please input the number ... : "; $input_var = <STDIN>; } # do your stuff with $input_var # output result
In reply to Re: restart program on wrong user input.
by b4e
in thread restart program on wrong user input.
by BioGeek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |