in reply to Re^2: printing contents of small files into one larger one
in thread printing contents of small files into one larger one

Fair enough. I should have read the question!

I have modified the technique to build an AoA in memory before writing it out. The OP wasn't clear on how files of differing length were to be treated. The code below expands the AoA as necessary to cope with files of different lengths.

my @lines; my $line = 0; my $filecount = 0; while (<>) { chomp (${$lines[$line++]}[$filecount] = $_); if (eof) { $line = 0; $filecount++; } } foreach (@lines) { $#{$_} = $filecount -1; print join("\t", @{$_}), "\n" ; }