One of the (for me) more annoying gotchas. Inside a single-quoted string, \ is still special. '\\' is just a single \, and '\'' is a single-quote.
So if you need to, by chance, wind up with \\, even with a single quote you still find yourself doing \\\\. | [reply] |
$ cat test
$var = 'c:\test\file.txt';
print "$var\n";
$ perl test
c:\test\file.txt
Update: My bad; I see what you're saying.. It needs to examine \ because you may need single-quotes in your single-quoted string.
print '\\'; # prints "\" not "\\"
| [reply] [d/l] [select] |