Edward Peschko writes:
: Anyways, my one curiosity that sticks out would be: why \Q as being a way to
: disambiguate? You could do the same thing with:
:
: print "$foo\[1]\n"
: vs
: print "$foo[1]\n";
Not good enough. Consider what this might means:
m/$foo\[a-z]\n/
Is it matching a literal [ or starting a character class?
What people need to realize is that the ugliness of \Q is a feature.
It's designed to stop you in your visual tracks.
But I really don't mind nested structures--the problem with ${foo[bar]}
was precisely that it *wasn't* nested right. So the people who still want
to use nesting can always use expression interpolation:
print "$( $foo )[1]\n"
which I think can reasonably be made to stop parsing at the right paren.
(Though a case could be made for continuing there too... However, I
expect that anything you could do outside the parens you could also
do inside, so there's no reason not to stop parsing there.)
Larry