for (my $i=0; $i<@array1; $i++) { open (OUT, ">$$.out") or die "can't open OUT\n"; print OUT ">$array1[$i]>$array2[$i]\n\n\n"; }