sub f { my @a1 = @{shift}; my @a2 = @{shift}; print "$_\n" for @a1; ... }