print "Can you read this? "; my $answer = ; if ($answer =~ /^y(?:es)?$/i) { print "Excellent\n"; } else { print "Then how did you answer?\n"; }