in reply to Re: Get stricter with use warnings FATAL => 'all';
in thread Get stricter with use warnings FATAL => 'all';

mje,

Thank you for the feedback.

This would not work for some code I use as warnings are often issued with warn()
If you are referring to warn, then there is no problem. use warnings FATAL => 'all'; will not cause a warn to die, as shown by this example:
use warnings FATAL => 'all'; use strict; warn "foo\n"; warn "bar\n"; __END__ foo bar

I have never used Log::Log4perl (or any similar logging modules), but I would be surprised if it promoted its warnings to fatals. When I get a chance, I will try to figure out how to use the Log module to confirm your assertion. Feel free to post a small example which proves this. Thanks for pointing this out.

UPDATE: Here is my 1st attempt at using Log::Log4perl. In this mode, the warning is not promoted to a fatal. I have more to learn about the module.

use strict; use warnings FATAL => 'all'; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($DEBUG); WARN("foo"); DEBUG "A low-level message"; ERROR "Won't make it until level gets increased to ERROR"; WARN('bar'); __END__ 2011/10/12 21:05:08 foo 2011/10/12 21:05:08 A low-level message 2011/10/12 21:05:08 Won't make it until level gets increased to ERROR 2011/10/12 21:05:08 bar
I also tried the Core Log::Message module, and I did not observe warnings turning into fatals there either.

Replies are listed 'Best First'.
Re^3: Get stricter with use warnings FATAL => 'all';
by mje (Curate) on Oct 13, 2011 at 17:36 UTC

    toolic thanks for that. My mistake. I believed (erroneously) that FATAL => 'all' caused all calls to warn to die. Having reread the documentation it appears I still don't get FATAL => 'all' - do you know where that is documented? I can only find FATAL mentioned in perldoc warnings but it is not clear how this works.

      I still don't get FATAL => 'all' - do you know where that is documented?
      From warnings, follow the link to perllexwarn -> Fatal Warnings (I just added this to the OP as well).