in reply to getting arrays into subroutines

Short answer: Pass references to the arrays as:

... sub something { my ($ary_ref1, $ary_ref2, $ary_ref3) = @_; ... } ... something( \@ary1, \@ary2, \@ary3 ); ...

Long answer: Read perlreftut and perlref