While investigating common::sense, I noticed the exhortation to use FATAL warnings. I don't remember seeing this option before, so I thought I'd try it out:

$ perl -le 'use warnings qw(FATAL); my $a = "2:" + 3; print $a' 5
Hmmm. That didn't work so well. Did I do something wrong?
$ perl -le 'use warnings; my $a = "2:" + 3; print $a' Argument "2:" isn't numeric in addition (+) at -e line 1. 5
Nope, the warning message comes up fine here... well, maybe the "all" is only implied when there actually are no arguments at all.
$ perl -le 'use warnings qw(FATAL all); my $a = "2:" + 3; print $a' Argument "2:" isn't numeric in addition (+) at -e line 1.
Aha. There we go. FATAL only works when giving another option. I have to admit, that was unexpected. At the very least, if FATAL with no more arguments doesn't imply "all", I would hope for a warning of some sort. It is the warnings pragma, after all! :-)

(*) I was looking at common::sense as a point of comparison. I'm not in agreement with all of the authors' conclusions, but the concepts are good: automatically engaging strict, warnings, oft-used features, etc., with a single use call rather than mandating a whole bunch of boilerplate. I'd be tempted to use such a module to import a bunch of other stuff, too, but will probably hold off on that as it would start to hide where our logging is coming from (Log::Log4perl) which would serve to confuse rather than simplify.


In reply to using FATAL warnings by Tanktalus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.