use strict; use warnings; use FileHandle; my @files = ("test1.dat", "test2.dat", "test3.dat"); my @handles; @handles = map { FileHandle->new ($_) } @files; my $while = 1; while ($while) { my @lines; for ( @handles ) { $while = 0, last if $_->eof; $line = $_->getline; chomp $line; push @lines, $line; } print join ("\t", @lines), "\n"; }