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.)
In reply to Re: why doesn't "my ($a,$b)" return a list?
by ikegami
in thread why doesn't "my ($a,$b)" return a list?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |