http://www.perlmonks.org?node_id=902080


in reply to slashes in single-quoted string

For me, its enough to have a personal rule that if a string contains ' (or " when I'm interpolating), I then use the q and qq operators. This way I never have to escape a character in a string.

Replies are listed 'Best First'.
Re^2: slashes in single-quoted string
by LanX (Saint) on Apr 29, 2011 at 21:49 UTC
    > This way I never have to escape a character in a string.

    DB<100> print q{\n} \n DB<101> print q{\\n} \n DB<102> print q{\\\n} \\n

    Cheers Rolf