in reply to Re^6: map in void context
in thread map in void context
which just makes me wonder about list assignments ... must check if their return value really is a list of all assigned values
In list context, list assignment evaluates to the list of elements actually assigned.
my @x = ($a,$b) = (4,5,6); # @x = (4,5)
In scalar context, list assignment evaluates to the number of elements to assign.
my $x = ($a,$b) = (4,5,6); # $x = 3
Remember, x = y = z means x = ( y = z ) because assignment is right-associative.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: rv of list assignment (was "map in void context")
by pat_mc (Pilgrim) on Dec 22, 2008 at 09:09 UTC | |
by tilly (Archbishop) on Dec 22, 2008 at 09:17 UTC | |
by ikegami (Patriarch) on Dec 22, 2008 at 13:29 UTC | |
by pat_mc (Pilgrim) on Dec 22, 2008 at 23:47 UTC |