$ $ perl -wE 'say "ouch" if "foo\n" =~ /^foo$/' ouch $ perl -wE 'say "ouch" if "foo\n" eq "foo"' $ # no output