in reply to Re: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}
in thread Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}
To be more precise, the \ operator gives its argument list context, which may surprise many people (it did me).
Why would this surprise you? :)
If I ask for a reference to an array that contains ('foo', 'bar', 'baz'), I expect a reference to an array that has three elements in it, not the number 3 (as would be the case if \ provided scalar context for its arguments.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}
by adrianh (Chancellor) on Aug 24, 2003 at 11:31 UTC | |
by bradb (Sexton) on Aug 25, 2003 at 00:42 UTC | |
by adrianh (Chancellor) on Aug 25, 2003 at 23:58 UTC | |
Re^3: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}
by Aristotle (Chancellor) on Aug 24, 2003 at 07:31 UTC |
In Section
Meditations