This is why it is a sin to "use warnings" in modules. :) I never do that. I always do "-w" in my *.t files instead.

If I want to see warnings from your module, then I'll use "-w". You shouldn't be telling me whether or not I want to see warnings from your module.

I actually hope that there is some warnings.pm magic that would let me turn on/off warnings from a specific package but nobody so far is familiar with such a feature (and I'm not and I don't see such documented in warnings).

You could certain go the moderately ugly route of writing a $SIG{__WARN__} handler to throw such away.

And you can use -X to disable all warnings. But I got the impression that you wanted to see your own warnings.

I'd certainly patch Contextual::Return to not "use warnings" (and add -w to all of the *.t files) and submit that back to the module's maintainer.

And it looks like there is room for improvement in making it easy to ignore warnings from a specific module (that did "use warnings" and didn't test well enough, likely).

- tye        


In reply to Re: I don't care about *your* warnings! (-X) by tye
in thread I don't care about *your* warnings! by agianni

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.