use strict; use warnings; my @single = (1); my @many = (1 .. 3); for my $ref (\@single, \@many) { my $count = listy(@$ref); my @elements = listy(@$ref); my ($firstElement) = listy(@$ref); print "Count $count, first: $firstElement, elements: @elements\n"; } sub listy { return @_; }