> perl -le 'open AA, ">/tmp/stderrtest"; close(STDERR); warn "Hello"; +close AA;' ; cat /tmp/stderrtest >
As you can see it is not the next filehandle/file descriptor that warn() prints to, but just to file descriptor 2. When you close STDERR the newly opened file gets the now vacated file descriptor
In reply to Re: Using warn() when STDERR is closed
by jethro
in thread Using warn() when STDERR is closed
by akeyes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |