Quoth "Paul Lalli said:
No, because this isn't a list assignment. By definition, a list
assignment is assigning something to a list. Nothing is being assigned
to a list here.
This is all true.
More to the point, there is no "list" in that
expression. There is a scalar being assigned the return value of the
comma operator.
This, however, is not. The comma operator constructs lists; a list
evaluated in scalar context evaluates all its members but the last in
void context and the last in scalar context, which is then the list's
value.
perl -MO=Graph,-dot -e'my $count = (1,2)' | dot -Tps
produces output the pertinant parts of which look somewhat like:
leave(LISTOP) { # end scope
enter(OP) # start scope
nextstate(COP) # start a statement
sassign(BINOP) { # scalar assignment
list(LISTOP) { # build a list
pushmark(OP) # mark the start of the list on the stack
null(OP) # the optimizer has deleted the 1
const(SVOP) # refers to an IV, the 2
}
padsv(OP) # retreives $count to assign into
}
}
(these op trees are executed inside-out, so the execution order is
enter, nextstate, pushmark, null, const, list, padsv, sassign, leave
as you would expect)
Note the 'list(LISTOP)': perl is building a list and then performing a
scalar assignment of that list to $count.
Ben