good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Yes, but not for the reason you're implying. You're thinking @a is evaluated in scalar context when it's not. Both operands of the list assignment (@a and empty_listX()) are evaluated in list context. If @a is an operand of the list assignment, what's the operand of the scalar() pseudo-operator? The list assignment. scalar() causes the list assignment to be evaluated in scalar context. In scalar context, the list assignment operator returns the number of elements returned by its right hand side operand. Since it doesn't matter to what you are assigning, you could just as easily have written
In reply to Re^2: Empty List miracle(1)
by ikegami
|
|