print "Please enter a word from the letters above: "; chomp(my $word = ); #INPUT WORD if ($word =~ /[$random_string]$/i) { print "Good word\n"; last; } else { print "try again\n"; print "\n"; }