http://qs321.pair.com?node_id=228389


in reply to Returning lists vs arrays

--Reposting my answer from the duplicated node--

I think you're confused by the distinction between arrays and lists. Lists are a bunch of values, while arrays are variables that hold values. See perlfaq4.

Outside your subroutine, the distinction doesn't matter. It will all look like arrays:

sub return_array { my @a = (0, 1, 2, 3); return @a; } sub return_list { return (0, 1, 2, 3); } my @array1 = return_array(); my @array2 = return_list();