[ Please use <c>...</c> tags around your code ]
Switching from a lexical to a global variable changes nothing. You're still overwriting (and thus closing) the previous pass's file handle every time you go through the loop.
You need to store the the handle somewhere it doesn't get overwritten, such as in an array.
In reply to Re^3: Perl File Handle Count not working as expected, why?
by ikegami
in thread Perl File Handle Count not working as expected, why?
by radnus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |