in reply to scalar value of list assignment
This is documented in perlop:
Similarly, a list assignment in list context produces the list of lvalues assigned to, and a list assignment in scalar context returns the number of elements produced by the expression on the right hand side of the assignment.This is not the same as "scalar-context value of the list on the right hand side of the assignment". First of all, there is no list in scalar context (duh! if the context is scalar, it ain't list!), and second, if you mean, "the value of the expression on the RHS of the assignment, but then in scalar context", it's wrong as well, as the value of qw(first second third) in scalar context is third, not 3.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: scalar value of list assignment
by tantalor (Initiate) on Jan 17, 2012 at 20:22 UTC | |
by JavaFan (Canon) on Jan 17, 2012 at 20:40 UTC |