> But why is this always considered a necessary feature for a quoting delimiter, trumping all other considerations like avoiding headaches like the OP describes?

I didn't say it's a necessary, I explained the motivation "If ... you want to allow ...".

> What would prevent the usage of the delimiting character as its own escape character? I.e. two consecutive single-quotes would not terminate a single-quoted string literal

IIRC VB (or VB-Script) does something like this.

> I don't see any reason for ever wanting to put two string literals right next to each other without space or comma in between, so it would not create any syntactical ambiguity.

empty string?

> Or am I missing something?

Perl has already a very complex syntax, adding new extra DWIM exception doesn't make it easier.

What might be easy and meaningful for you can be line noise or just complexity horror for someone else.

For instance see this discussion about the differences between Perl and JS in handling the closing bracket in regex-character classes: Regex: Char-class equivalent for [^].

So in short: Rules have to be kept as simple as possible and backslashing is a well-established notation.

Moritz already mentioned a new way in Perl6, which sounds reasonably simple, so help is on the way for the next version.

EDIT: And for the records: The OP might hate them but I LOVE HERE-DOCS!!!

Cheers Rolf


In reply to Re^3: Single Quotes - how to avoid any escape processing? by LanX
in thread Single Quotes - how to avoid any escape processing? by temporal

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.