in reply to RE: RE: RE: RE: slash converter
in thread slash converter

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 \\\\.

Replies are listed 'Best First'.
RE: RE (tilly) 5: slash converter
by Fastolfe (Vicar) on Oct 13, 2000 at 22:37 UTC
    Weird..
    $ 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 "\\"