Why I did it...I skip ahead (in the second loop), looking for the next record.
I may be missing something (you haven't said what the second loop actually does, so I can't be sure), but couldn't this be better handled with next ?
Regarding the soap box, as rjray pointed out, the important part here is the list context. I don't have the camel on me at the moment, but the behaviour of filehandles in list context is documented in perldoc perlintro as well as perldoc perltrap.
In reply to Re^3: nested <FILE> read returns undefined?
by tirwhan
in thread nested <FILE> read returns undefined?
by argv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |