#!/usr/bin/perl use warnings; use strict; $_ = 'foo@@bar'; print "matched\n" if /@@/; print "matched\n" if /\Q@@\E/; print "matched\n" if /\@\@/; __END__ matched matched matched #### #!/usr/bin/perl use warnings; $_ = '@@'; print "1 matched\n" if /^@@\z/; print "2 matched\n" if /^\Q@@\E\z/; print "3 matched\n" if /^\@\@\z/; print "4 matched\n" if /^\Q@@x\E\z/; # doesn't match, because @x is being interpolated print "5 matched\n" if /^@\@x\z/; # doesn't match, because there is no 'x' in the string __END__ Possible unintended interpolation of @x in string at ./811585.pl line 10. Name "main::x" used only once: possible typo at ./811585.pl line 10. 1 matched 2 matched 3 matched