Don't ask to ask, just ask | |
PerlMonks |
Re^2: Return Value of List-Producing Elements in Scalar Contextby LanX (Saint) |
on Jul 28, 2013 at 14:26 UTC ( [id://1046742]=note: print w/replies, xml ) | Need Help?? |
> A "list producing expression used in scalar context" does not produce a list. It just produces a single value, which is the last element in the comma-delimited expression. Maybe better phrased "a list-producing expression used in scalar context" will not produce an intermediate LIST which is then evaluated in scalar context, but a scalar is produced depending on the value.
I wonder if a listify operator could help avoiding bugs when changing the return expression of a sub.
Cheers Rolf ( addicted to the Perl Programming Language)
In Section
Seekers of Perl Wisdom
|
|