Oh - I completely missed that.
The title in the question likely stems from a erroneous use of $! in the die message.
As an explanation to the OP, please read perlvar about $!. It rightly says there:
Many system or library calls set errno if they fail, to indicate the cause of failure.
Using $! in situations that are not immediately after a related system call is usually wrong.
In reply to Re^2: Bad file descriptor error
by Corion
in thread Bad file descriptor error
by zing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |