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

I have never found the reason for the first exception to be obvious.

Perl has enough quoting mechanisms that I think it would be more valuable to have one that makes it easy to include a row of backslashes in than it is to have every one able to put out any possible text you could want.

Heck, just the fact that the rules for single-quoting are so widely understood (as can be seen from people wondering at what it does) strongly suggests that something is wrong with the rule as it stands.

Replies are listed 'Best First'.
Re: Single quoting weirdness
by Abigail-II (Bishop) on Jun 07, 2002 at 12:07 UTC
    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

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