in reply to Re: Re: Single quoting weirdness
in thread Single quoting weirdness

Escaping the escape character seems to be used in about any escaping mechanism that I can recall. That's hardly a Perl specific thing. And not being about to escape the delimiter is just very awkward. Do you like stuff like:
echo '$foo'"'"'$bar'
just to be able to echo
$foo'$bar
like you have to do in many shells?

Abigail

Replies are listed 'Best First'.
Re: Re: Single quoting weirdness
by Anonymous Monk on Jun 08, 2002 at 00:58 UTC
    Do I like that? Nope. But if shells were like Perl, then I could do either of the following:
    echo q($foo'$bar) echo "\$foo'\$bar"
    and I find the former in particular to be very convenient. If there was only one quote delimiter to choose from, well that is a pain. But with the range of choices in Perl, it is pretty rare to run across a single-quote situation that wouldn't work easily.

    OTOH there is no syntax in Perl that gives you a row of backslashes easily. And given the way the rest of Unix works, I often want exactly that (just to pass a single backslash through several layers of interpolation - each of which loses half of them).