for (my $i = 0; $i < scalar @arr1; ++$i) { my @garr = (@$arr1[$i], @$arr2[$i]); # do main processing on @garr here. }