#! /usr/local/bin/perl -w # Open many file handels # C's code foreach my $file (@ARGV) { my $fh; open $fh, "<", $file or die "Can't open $file ($!)"; push @filehandles, $fh; } while (1) { $line = undef; # Not sure whether this is even required. foreach (@filehandles) { $line .= <$_>; chomp($line); } print ($line,"\n"); last if undef($line); }