in reply to Say it isn't so, -MO=Deparse!
$x = (4, 5, 6) is a scalar assignment, assigning 6 to $x, and returning $x in scalar context.
($x) = (4, 5, 6) is a list assignment, assigning 4 to $x, and returning 3 (elements on the right) in scalar context.
FWIW, this happens for me in 5.6.2, but not in any perl 5.8.0 or greater. Update: by "this", I mean the bug where Deparse drops the () around the $x, changing what should be a list assignment into a scalar assignment. The behaviours I cite above of list and scalar assignments are correct and documented.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Say it isn't so, -MO=Deparse!
by tlm (Prior) on Apr 03, 2005 at 23:26 UTC | |
|
Re^2: Say it isn't so, -MO=Deparse!
by moot (Chaplain) on Apr 04, 2005 at 04:13 UTC | |
by ysth (Canon) on Apr 04, 2005 at 10:01 UTC |