in reply to restart program on wrong user input.

The easiest is probably a goto:
TOP: my $num = <STDIN>; if( $num != 10 and $num != 0 ) #ok, a horrible condition { goto TOP; } #rest of code
Other ways would involve possibly a subroutine or hacking about with a while loop:
my $input; while( $input != "good" ) { print "Please enter number:\n"; $input = <STDIN>; } #rest of code