in reply to Dereference Empty(!) Array

As mentioned by others already, your ding sub isn't doing anything terribly useful other than returning as an array the length of the first array passed in by reference. What do you purport to use ding for?

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 #### ]

Also, rather than assigning to @foo inside ding and having to rely on the closure (i.e. @foo being defined prior to the sub being defined), why not just return from the sub and assign outside of the sub?