in reply to Checking input against known

Since you don't seem to care about what the casing was that the user entered, why not just upper (or lower) case it?
my @known = qw/FOO BAR BAZ/; print "Talk to me, Goose. "; my $input = <STDIN>; chomp($input); $input = uc $input ; if( grep { $input eq $_ } @known ){ print "You gave us $input, which is known. Have a nice day.\n"; }else{ print "bad input: $input\n"; }