$ perl -wle'print q{@@x} =~ m|\A\Q@@x\E\z| ? "match" : "no match"' Possible unintended interpolation of @x in string at -e line 1. Name "main::x" used only once: possible typo at -e line 1. no match $ perl -wle'print q{@@x} =~ m|\A@\@x\z| ? "match" : "no match"' match