in reply to restart program on wrong user input.
Other ways would involve possibly a subroutine or hacking about with a while loop:TOP: my $num = <STDIN>; if( $num != 10 and $num != 0 ) #ok, a horrible condition { goto TOP; } #rest of code
my $input; while( $input != "good" ) { print "Please enter number:\n"; $input = <STDIN>; } #rest of code
|
|---|