in reply to printing to new output files within a loop

Try adding the index to the file name and closing the file inside the loop. Right now you are over-writing the file each time.
for (my $i=0; $i<@array1; $i++) { open (OUT, ">$$.out.$i") or die "can't open OUT\n"; print OUT ">$array1[$i]>$array2[$i]\n\n\n"; close(OUT) or die "Close error on $$.out.$i -- $!\n"; }

----
I Go Back to Sleep, Now.

OGB