use Tie::File; use strict; use warnings; my @files_as_arrays = map { my @a; tie @a, 'Tie::File', $_; \@a } @ARGV; { local( $,, $\ ) = ( "\t", "\n" ); my $i = 0; while (1) { my @a = map { $_->[$i] } @files_as_arrays; $i++; grep { defined $_ } @a or last; no warnings; print @a } } #### use IO::File; use strict; use warnings; my @filehandles = map { new IO::File $_, 'r' } @ARGV; while (1) { my @a = map { $_->getline } @filehandles; grep { defined $_ } @a or last; no warnings; print join( "\t", @a ), "\n"; }