in reply to Re^2: Single Quotes - how to avoid any escape processing?
in thread Single Quotes - how to avoid any escape processing?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Single Quotes - how to avoid any escape processing?
by smls (Friar) on Jan 31, 2013 at 22:57 UTC | |
|
Re^4: Single Quotes - how to avoid any escape processing?
by temporal (Pilgrim) on Jan 31, 2013 at 22:55 UTC |