Like so:
Roboticus@Roboticus-PC ~ $ cat ret.pl #!/usr/bin/perl my ($x, $y) = foo(); print "x=$x, y=$y\n"; sub foo { return 3, 5 } Roboticus@Roboticus-PC ~ $ perl ret.pl x=3, y=5
You simply return a list of values. You can't use two successive return statements, because after the first one, the second will never execute.
...roboticus
In reply to Re: return more than 1 value
by roboticus
in thread return more than 1 value
by changma_ha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |