in reply to Reading two lines per loop iteration

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

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."