Obviously, there ARE situations when you want to get these warnings,

Just to be clear, I usually use #!/usr/bin/perl -w (as the first line of each script) which means that I get more warnings than I would if I used use warnings;.

Users of a script usually don't have many ways of giving the script undefined values so the line between "script user" and "script" is not the same as the line between between "module user" and "module" with regard to warnings. If I test a script well, then I usually won't leave it up to the script user to launch via "perl -w ..." in order to get warnings.

However, for scripts that get run other than by other either developers or IT workers, I do indeed sometimes leave warnings turned off when the script is deployed. Warnings seen by a non-technical user or written to a Production log file are very often worse than useless. The lower the odds of "the warning making it back to a developer along with sufficient information for the cause of the warning to be identified so the code can be fixed to eliminate the warning (and perhaps a bug that the warning detected)", the less value there is to leaving warnings enabled.

- tye        


In reply to Re^3: Common uses of "use" (warnings?) by tye
in thread Common uses of "use" by mjscott2702

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.