in reply to Re: \ in single quotes (Re: DOS directory naming in PERL?)
in thread DOS directory naming in PERL?
The biggest flaw with your suggestion is that changing the quoting character means scanning the string to make two changes instead of one; the previous delimiter must be made single everywhere it is double, and the new delimiter must be made double everywhere it is single.
Ah, and this is different in the current scheme, how? (:
q'The string\'s "old" delimiter isn\'t new' # Change the delimiter from ' to " and... q"The string's \"old\" delimiter isn't new" # we have to change _both_ old and new delims, cuz... q"The string\'s \"old\" delimiter isn\'t new" # would end up including \s in front of the old delims...
In fact, Perl's documentation explicitly state that in a double-quoted string, a backslashed non-word character always means the literal character.
...because we aren't talking about double-quoted strings but single-quoted strings.
So if this is the biggest flaw with my proposal, I still assert that it would be a better choice to go along with the other quoting methods provided in Perl.
- tye (but my friends call me "Tye")
|
|---|