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


in reply to reading two files in parallel

Nested loops will not give you what you need. Besides Moritz's solution, you could also use one loop on one of the files (but not on the other):

while (my $a = <F1>) { my $b = <F2>; # do something with $a and $b }