laziness, impatience, and hubris | |
PerlMonks |
Re^2: Why does assignment change the result?by blazar (Canon) |
on May 23, 2007 at 21:58 UTC ( [id://617123]=note: print w/replies, xml ) | Need Help?? |
A list in scalar context is its rightmost element, an array in scalar context is its size. You're right of course. But then you got me thinking... why does the ()= trick work? It is supposed to put its rhs in list context and then is generally put back in scalar context to get the length of a generated list... Is it special cased?
(This prints 3 of course.)
In Section
Seekers of Perl Wisdom
|
|