http://www.perlmonks.org?node_id=1031796


in reply to Re: reading two files in parallel
in thread reading two files in parallel

The necessary additions, to be placed after what is shown, are trivial

No. The trivial additions are most certainly wrong.

If F2 is exhausted first, the last line read from F1 inside the loop is lost, because $a is scoped to the block, and last leaves that block.