Notice that after you die, you try to execute that block of code an additional time. ("Can't use an undefined value ... at ... line 480.") That means you try to close the file handle more than once.
We know you try to close the file handle twice. Or rather, at least twice. I suspect there are actually three attempts. Specifically, I suspect you've tried one once before the attempt that died, and that the first attempt was successful.
In reply to Re: Bad file descriptor when trying to close file handle
by ikegami
in thread Bad file descriptor when trying to close file handle
by fireblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |