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 }
In reply to Re^2: Reading two lines per loop iteration
by blazar
in thread Reading two lines per loop iteration
by fishnflute
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |