Until (defined $input && $input == $answer) { print "Sorry that's not right, please try again\n" if defined $input;