It's always use warnings, sometimes just use warnings, and other times use warnings FATAL => 'all';, which is the same as use warnings qw( FATAL all );... just a cooler way of typing it.

One of the best ways to prevent bugs from creeping into a program is to write it with as much "questionable behavior" or "questionable practice" detection enabled as possible. This is why C compilers have strict modes, why Perl has strict, and so on. FATAL => all elevates to the level of throwing an exception when a warning occurs. It's like saying, "I want warnings to be exceptional situations." Stop everything, hold the horses, go directly to jail, do not pass go ----- we need to fix this!

There are times where STDERR is routed to a log file, where it won't be immediately seen by the developer or maintainer unless he goes looking for it. Perhaps it gets buried behind a bunch of other stuff that isn't relevant, and it becomes hard to determine the context under which the warning occurred. By stopping the run immediately, nothing else (or very little else) will be in the log. Context becomes more readily apparent.


Dave


In reply to Re: Difference Between use warnings and use warnings FATAL => 'all' by davido
in thread Difference Between use warnings and use warnings FATAL => 'all' by Jim

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.