in reply to Re: Log message in Die handler
in thread Log message in Die handler

Good grief. This seems to imply that if you close STDERR then die (and other diagnostics ?) will happily be written to whatever happens to be attached as descriptor 2 ?

If so, then the trick appears to be to open STDERR '>', '/dev/nul', or something else to occupy descriptor 2 to squelch output ? Thinking about a more portable solution I tried:

use strict ; use warnings ; sub die_handler { open FH, ">&1"; print FH "die_handler: ", @_ ; } ; $SIG{__DIE__} = \&die_handler ; close STDERR ; open STDERR, '<', \'' ; die "Oh shoot !" ;
which appears to do the trick. Noting that the close STDERR is required.