No such thing as a small change | |
PerlMonks |
Re^13: If you believe in Lists in Scalar Context, Clap your Handsby ysth (Canon) |
on Oct 28, 2008 at 06:25 UTC ( [id://719916]=note: print w/replies, xml ) | Need Help?? |
The assignment operator itself happens to be both in scalar and in list context. It produces both a list for the list, and a scalar for the function scalar().No. The assignment operator does the assignment, but it doesn't produce a list. The assignment is the side-effect; the result is a scalar due to the scalar context. Similar to how the ++ in perl -we'print $i++' produces 0 while incrementing $x.
In Section
Meditations
|
|