in reply to Returning two lists from a sub

You need to use references to avoid the flattening you noticed:
my ($a, $b) = getarrayrefs(); print join(" ", @{ $a }), "\n", join(" ", @{ $b }); sub getarrayrefs { my @foo = (1,2,3); my @bar = (4,5,6); return \@foo, \@bar; }
Phil

Update: Corrected sub name to match call. Thanks Albannach.

The Gantry Web Framework Book is now available.