... print "enter a number" my $num = unless ($num =~/[0-9]+/){ print "this is not a number\n please type a number" } print "your number is $num"; ...