in reply to Returning two lists from a sub

You need to return two array references from the subroutine.

use strict; use warnings; my ($ref_to_a, $ref_to_b) = getlists(); print qq{@$ref_to_a\n@$ref_to_b\n}; sub getlists { my @foo = (1,2,3); my @bar = (4,5,6); return \@foo, \@bar; }

BTW, interpolating an array inside double quotes will, by default, space-separate the elements; you don't need the join.

Cheers,

JohnGG