use warnings; use strict; use 5.012; use Smart::Comments '###'; my @foo; sub ding { @{$_[0]} || (); } my @a = qw(apple banana pear grapes); my @b = qw(lettuce onions); my @c = qw(popcorn ice-cream); @foo = ding(\@a, \@b, \@c); ### @foo #--- Result: #### @foo: [ #### 4 #### ]