use strict; use warnings; open (T1, "t1") or die; my @file1 = ; my @file2 = ; my @file; while (@file1 and @file2) { push @file, (shift @file1, shift @file2); } push @file, @file1 or @file2; #catch any leftover while (my $line = shift @file) { #do 'things' with it print $line; } __END__ file1 file1 file1 file1