in reply to Re: Interactions of \Q, \U, \L and \E
in thread Interactions of \Q, \U, \L and \E

Wait! That's not what Perl gives. Argh, not my day. There's a bug :( (in the docs if not in the interpreter).

What you described (\Q, \U and \L all being terminated at the next \E) is one of the more consistent alternatives to what perl actually does. It would be simpler to implement, document and understand. But, as you note, perl doesn't behave this way.

$ perl -e 'print qq(\Qab,cd\Uef,gh\Lij,kl\Emn,op\Eqr,st\Euv,wx\n)' ab\,cdEF\,GHij\,klmn\,opqr,stuv,wx

There isn't necessarily a bug (i.e. incorrect statement) in the documentation - it may be just an omission. It describes \Q, \U and \L separately. It doesn't say anything about what happens when they are nested or overlapped or concurrent(or however one might choose to describe the situation in the test case above). When used separately, they behave just as the documentation says they do.

Replies are listed 'Best First'.
Re^3: Interactions of \Q, \U, \L and \E
by ikegami (Patriarch) on Aug 25, 2009 at 17:15 UTC

    There isn't necessarily a bug (i.e. incorrect statement) in the documentation - it may be just an omission

    The docs says the conversion occurs until \E, but perl keeps going pass \E in some circumstances. Call it what you want.