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. Miss fixing the original delimiter in one case, and you've changed your string, with no hint that it was ever different.
On the other hand, with backslashing, the backslashes don't need to be removed from the old delimiter. In fact, Perl's documentation explicitly state that in a double-quoted string, a backslashed non-word character always means the literal character. You never have to worry about how the string should be interpreted, unlike your scheme where ** could mean one asterisk or two, depending on the delimiters used.
Both approaches have advantages and disadvantages, and both are used in a lot of places. I don't think it's obvious that one solution is necessarily better than the other.
In reply to Re: \ in single quotes (Re: DOS directory naming in PERL?)
by chipmunk
in thread DOS directory naming in PERL?
by phathead22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |