SPUG: scanning directories

Matt Tucker tuck at whistlingfish.net
Thu Nov 30 23:37:02 CST 2000


-- Daniel Jacobs <danielj at cheshirecat.net> spake thusly:

> Do you possibly need to escape the '/' characters? i.e.
>
> $portal{BASEDIR} = "\/\/machinename\/sharedirectory";

This would do absolutely nothing in Perl. Escaping forward slashes is never necessary unless you're using them as the separator character for 
regexes or quotes, in which case you should just pick a different separator.

I really wish people would take the time to learn what does and doesn't 
need to be escaped in Perl. Excessive backslashes make code more difficult to read, and I've seen far too much gratuitous use of them. It's too bad, really, because Perl provides enough ways to avoid them (alternate quote characters, heredocs, \Q...\E, etc.) that they're hardly ever necessary for anything other than metacharacters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://mail.pm.org/archives/spug-list/attachments/20001130/831ef0f9/attachment.bin


More information about the spug-list mailing list