If you start with the premise that code should be warnings-clean in the first place, then it only seems logical to leave warnings on in production code -- because any warning that appears then indicates either (a) a real problem or (b) something that apparently works, but was overlooked when the code was declared to be warnings-clean. Case (b), despite not being an outright failure, is certainly unanticipated, and may indicate oversights in the design or spec. Either way, I'd prefer to know rather than ignore it. (And if you don't want your users seeing it, you can of course trap the warnings and send them to an application log file or some such.)

Secondarily, I tend to believe that changing as few things as possible between "pre-production" and "production" code is generally smart. It's hard enough to debug problems on code running in an alien environment when the code is bit-for-bit identical to what you're running in your dev or test environment. Why add another variable to the equation if you don't have to. (I know, simply removing 'use warnings' shouldn't cause any problems, but since I don't see much benefit to removing it, why take the chance.)


In reply to Re: Releasing code with warnings by seattlejohn
in thread Releasing code with warnings by rir

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.