[Pdx-pm] subroutine calls CAN be string-interpolated!
Andrew Savige
ajsavige at yahoo.com.au
Sat Dec 10 15:43:24 PST 2005
--- Eric Wilhelm <scratchcomputing at gmail.com> wrote:
> And you thought they had to be concatenated with that messy
> quote-breaking " . thing($stuff) . " syntax.
>
> perl -e 'use constant foo => 7, 6; print "foo: @{[foo]}\n";'
>
> Is this undocumented or just obscure?
According to:
http://www.nntp.perl.org/group/perl.fwp/3727
the @{[]} "secret operator" was invented by Randal and/or
Larry in 1994.
BTW, cog dreamed up a (presumably) vulgar name for the @{[]}
operator, as alluded to here:
http://www.nntp.perl.org/group/perl.fwp/3726
I don't know what this name is though.
/-\
Send instant messages to your online friends http://au.messenger.yahoo.com
More information about the Pdx-pm-list
mailing list