On Mon, 17 Oct 2016 09:13:29 +0100, Dave Mitchell <davem@iabyn.com> wrote: > I've just spotted another issue with list assignment in list context. > Does anyone think the third case below is a bug? I think it should output > "1:u" like the second case: /me agrees. +1 > sub f { print join(':', map $_ // "u", @_), "\n"; } > > f(($a,$b) = () ); # prints "u:u" > f(($a,$b) = (1)); # prints "1:u" > f(($a,$b, %h) = (1)); # prints "1" > > on the principle that the return value of a list assignment is its LHS; > i.e. that @a = ((X) = (Y)) should be equivalent to (X) = (Y); @a = (X), > where (X) is a list of lvals, like ($a, undef, %h) -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.25 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/Thread Previous | Thread Next