in reply to Using warn() when STDERR is closed
> 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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using warn() when STDERR is closed
by almut (Canon) on Jul 15, 2010 at 16:27 UTC | |
by JavaFan (Canon) on Jul 15, 2010 at 17:57 UTC | |
by almut (Canon) on Jul 15, 2010 at 18:39 UTC | |
by tye (Sage) on Jul 17, 2010 at 17:36 UTC |