Jonathan Rockway wrote:
> $ "\L$foo"
>
> $
>
> Note that the cases above all warn, except the last one. I think it
> should... am I missing something? \U, \u, \l also do the same thing.
I'll betcha $5 that \L is implemented using the same op as lc()...
Yep, toke.c would seem to confirm.
/*
* Now come three functions related to double-quote context,
* S_sublex_start, S_sublex_push, and S_sublex_done. They're used when
* converting things like "\u\Lgnat" into ucfirst(lc("gnat")). They
* interact with PL_lex_state, and create fake ( ... ) argument lists
* to handle functions and concatenation.
* They assume that whoever calls them will be setting up a fake
* join call, because each subthing puts a ',' after it. This lets
* "lower \luPpEr"
* become
* join($, , 'lower ', lcfirst( 'uPpEr', ) ,)
*
* (I'm not sure whether the spurious commas at the end of lcfirst's
* arguments and join's arguments are created or not).
*/
--
...they shared one last kiss that left a bitter yet sweet taste in her
mouth--kind of like throwing up after eating a junior mint.
-- Dishonorable Mention, 2005 Bulwer-Lytton Fiction Contest
by Tami Farmer