Why not just read both lines at a time? It even seems to handle the case of the file ending with an odd line correctly.
#! perl -slw use strict; while( my $line = <DATA> . <DATA> ) { print "'$line'"; } __DATA__ 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 an odd record
In reply to Re: Reading two lines per loop iteration
by BrowserUk
in thread Reading two lines per loop iteration
by fishnflute
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |