in reply to Re: Reading two lines per loop iteration
in thread Reading two lines per loop iteration
This sort of thing?
while ( my $line1 = <$fh> ) { my $line2 = <$fh>; # etc }
Except that
while ( my $line1 = <$fh> )
is just the same as
while ( defined(my $line1 = <$fh>) )
so perhaps I would do:
while ( my $line1 = <$fh> ) { defined(my $line2 = <$fh>) or last; # etc }
|
|---|