http://qs321.pair.com?node_id=286098


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.)