Er. Not sure this ones valid. :-)
My point was mostly about escaping back slahes or a potential § somewhere in your code.
For instance
E:\blead> perl -e "print q§/\\\./§"
/\\./
So the regex that starts off being "match a backslash followed by a period" becomes "match a backslash followed by any non newline character". Not exactly the same thing. Whereas
#!perl
print <<'ENDOFHERE';
/\\\./
ENDOFHERE
Outputs the expected /\\\./
For this reason, I tend to do my best to avoid using the q// operator when Im trying to quote code. After all you never know when you'll stick a double backslash into the code, and it might save you hours of debugging trying to figure what the problem was, wheras the HEREDOC notation is only slightly more characters to write, with virtually no chance of this happening.
--- demerphq
my friends call me, usually because I'm late....
|