Don't ask to ask, just ask | |
PerlMonks |
Re: Is it evaluated in scalar or list context?by Athanasius (Archbishop) |
on Jan 20, 2013 at 04:13 UTC ( [id://1014248]=note: print w/replies, xml ) | Need Help?? |
Hello rnaeye,
This is correct, but from the rest of your question it seems you understand this to mean that it is $var which is in first scalar and then list context. Actually, it is something which is evaluated in either scalar or list context. That is, in an assignment, it is the right-hand side which is evaluated in either scalar or list context; the form of the left-hand side determines the context in which the right-hand side is evaluated. You can use wantarray in a subroutine to see this:
which outputs:
Hope that helps,
In Section
Seekers of Perl Wisdom
|
|