in reply to How can I tell at run time that my script is writing to STDERR?

use the $SIG{__WARN__}:
$SIG{__WARN__} = sub { die $_[0] }; warn "This will be fatal\n"; print "You will never get to this line\n";
See perlvar for more info.
  • Comment on Re: How can I tell at run time that my script is writing to STDERR?
  • Download Code