I have two arrays of equal size and want to simply print an element from each array to a new output file. e.g. $array1[[0]] and $array2[[0]] to a new file etc...
I thought this would work (below) but i'm only creating one new file. Where am I going wrong? Thanks!
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"; }
Edit by BazB: add code tags around arrays.
In reply to printing to new output files within a loop by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |