ig has asked for the wisdom of the Perl Monks concerning the following question:
Is there documentation of the interactions between \Q, \U, \L and \E escapes in quoted strings?
I have seen Quote and Quote like Operators, but this doesn't describe how these escapes nest that I can see.
$ perl -e 'print "\Qab,cd\Uef,gh\Lij,kl\Emn,op\Eqr,st\Euv,wx\n";' ab\,cdEF\,GHij\,klmn\,opqr,stuv,wx
One might expect
ab\,cdEF\,GHij\,klMN\,OPqr\,stuv,wx
update: or ab\,cdEF\,GHij\,klmn,opqr,stuv,wx.
update: or even ab\,cdEF\,GHIJ\,KLMN\,OPqr\,stuv,wx.
and
$ perl -e 'print "\Uab,cd\Qef,gh\Lij,kl\Emn,op\Eqr,st\Euv,wx\n";' AB,CDEF\,GHij,klmn,opqr,stuv,wx
where one might expect
AB,CDEF\,GHij\,klMN\,OPQR,STuv,wx
Is there a rationale for how they nest and override each other? I find the inconsistency between \Q on the one hand and \U and \L on the other hand to be surprising.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Interactions of \Q, \U, \L and \E
by jethro (Monsignor) on Aug 25, 2009 at 08:33 UTC | |
|
Re: Interactions of \Q, \U, \L and \E
by ikegami (Patriarch) on Aug 25, 2009 at 15:29 UTC | |
by ig (Vicar) on Aug 25, 2009 at 15:56 UTC | |
by ikegami (Patriarch) on Aug 25, 2009 at 17:15 UTC | |
|
Re: Interactions of \Q, \U, \L and \E
by ikegami (Patriarch) on Aug 25, 2009 at 13:42 UTC | |
by ig (Vicar) on Aug 25, 2009 at 15:02 UTC |