&viewThumbnails(\@array1, \@array2); # and then your subroutine looks like: sub viewThumbnails { my ($firstset, $secondset) = @_; # do something with these arrayrefs } #### my ($zero, $one, $two) = @_; #### my $zero = @_[0]; my $one = @_[1]; my $two = @_[2]; #### my $firstarg = shift;