http://www.perlmonks.org?node_id=440147


in reply to Re: passing arrays to subroutines
in thread passing arrays to subroutines

my $a=@_[0];

Unpacking @_ with explicit subscripts is inefficient and unsightly. Using an array slice in a scalar context is also messy.

my ($a)=@_;
or
my $a=shift;