# store the array in a variable my @foo = builder(); # pass it to another function to print the contents printer(@foo); # build array of arrays (sic) and return it sub builder { my @built = ( [qw/a b c d e f g/], [qw/1 2 3 4 5 6 7/], ); return @built; } # print the data sub printer { my @array = @_; foreach(@array) { print join(' ',@{$_})."\n"; } } __DATA__ a b c d e f g 1 2 3 4 5 6 7