in reply to Re^2: why doesn't "my ($a,$b)" return a list?
in thread why doesn't "my ($a,$b)" return a list?
The problem stays even without prototypes.
Really? With a better prototype:
$ perl -wE 'sub list { 1, 2}; sub enum(\@@) { @_[1,2] = (1, 2)}; enum +my @a, state ($x, $y); say $x, $y' 12
Or with no prototype:
$ perl -wE 'sub list { 1, 2}; sub enum { @_[0,1] = (1, 2)}; enum my @a +, state ($x, $y); say $x, $y' 12
To me this looks like the scalar context from the prototype was the problem - our maybe you meant a different problem? If so, care to elaborate?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: why doesn't "my ($a,$b)" return a list?
by LanX (Saint) on Aug 19, 2010 at 15:11 UTC |