in reply to Efficient way to print 2 columns from 2 Array of Arrays next to each other

It is somewhat shorter, and probably faster, to use a module for the inner loop.
use strict; use warnings; use List::MoreUtils qw(pairwise); my @AoA_first = ( [qw(a b c)], [qw(d e f)], ); my @AoA_second = ( [qw(1 2 3)], [qw(4 5 6)], ); for my $i ( 0 .. $#AoA_first ) { my $row_first = $AoA_first[$i]; my $row_second = $AoA_second[$i]; open my $TEMP, '>', "TMPFILES/$i.tmpfile" or die "Cannot open $i.tmpfile"; print {$TEMP} pairwise {"$a\t$b\n"} @$row_first, @$row_second; close $TEMP; }
Bill
  • Comment on Re: Efficient way to print 2 columns from 2 Array of Arrays next to each other
  • Download Code