You should never close STDERR. This first time your program tries to print to it, it can't, which creates another error, which it can't print, which creates another error, ...
Try this instead:
use File::Spec; open STDERR, '>', File::Spec->devnull() or exit( 1 );
In reply to Re: Using warn() when STDERR is closed
by shawnhcorey
in thread Using warn() when STDERR is closed
by akeyes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |