in reply to why doesn't "my ($a,$b)" return a list?
Prototype "$" imposes a scalar context on the corresponding expression in the parameter list. That means that my cannot possibly return a list. Without trying, I'd guess it returns the last of the values it would normally return. To avoid this problem, remove the prototype or use
tst(my $x, my $y);
(Spotty internet delayed my posting. Sorry for repeating what moritz covered.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: why doesn't "my ($a,$b)" return a list?
by LanX (Saint) on Aug 19, 2010 at 14:53 UTC | |
by ikegami (Patriarch) on Aug 19, 2010 at 15:19 UTC | |
by LanX (Saint) on Aug 19, 2010 at 15:24 UTC |