in reply to Reading multiple files.

Just use eof in a while loop. Don't forget to test that all file handles reached their end at the same time.
while (!eof(FILE1) && !eof(FILE2)) { my $line1 = <FILE1>; my $line2 = <FILE2>; ...
Probably a little easier to test if you're using lexical file handles.
use strict; use warnings; open my $fh, $0 or die $!; my @fhs = (\*DATA, $fh); while (! grep {eof($_)} @fhs) { my @lines = map {scalar <$_>} @fhs; print for @lines; } __DATA__ line1 line2 line3 line4 line5 line6

Replies are listed 'Best First'.
Re^2: Reading multiple files.
by pspillai (Initiate) on Mar 24, 2011 at 18:32 UTC
    Former works, Thank you. P.

      But you really should use lexical file handles, use three parameter open, check open results and use strictures (use strict; use warnings;). Funny how not doing all of that seems to go hand in hand, but surely you do all that good stuff. :)

      True laziness is hard work