in reply to Returning two lists from a sub
my $foo = [1,2,3]; my $bar = [4,5,6]; Then return the scalars. My rewrite: #!/usr/bin/perl use strict; my ($a, $b) = getlists(); print join(" ", @$a), "\n", join(" ", @$b), "\n"; sub getlists { my $foo = [1,2,3]; my $bar = [4,5,6]; return $foo,$bar; } I'm sure "There's More Than One Way To Do It", like usual, but this is + my way. Cheers! Howard
|
|---|