in reply to Re: wantarray - surprise behaviour
in thread wantarray - surprise behaviour
It is in list context because, and only because, the assignment operator is aassign and not sassign. I.e. since you're assigning to an aggregate the RHS will be in list context. It has nothing to do with the parenthesis or the comma. ( 1 => blah() ) can just as well be in scalar context in which case blah() will be called in scalar context.
$a = ( 1 => blah() ); __END__ wantarray =
ihb
Read argumentation in its context!
|
|---|