in reply to Re: Injecting a filter into warn()
in thread Injecting a filter into warn()

I thought of that, but did not want to remove all warnings of that type. Just the ones from the third party module.

tye hit the nail on the head (in the cb) - I had a -w in my shebang line.

Update: Clarified wording slightly.

--MidLifeXis

Replies are listed 'Best First'.
Re^3: Injecting a filter into warn()
by eyepopslikeamosquito (Archbishop) on Mar 10, 2005 at 21:41 UTC

    I thought of that, but did not want to remove all warnings of that type. Just the ones from the third party module.
    But if you insert the line inside the module, it only applies to that module. Generally, the warnings pragma is limited to the enclosing block -- so you could even apply it selectively to functions or blocks of the offending module if you wished.

    Don't get me wrong, I agree switching off the -w in the shebang line seems the best solution.

Re^3: Injecting a filter into warn()
by ikegami (Patriarch) on Mar 10, 2005 at 22:24 UTC
    You could use warnings instead of using -w. -w affects all lines processed by perl, no matter which module its parsing at the moment. use warnings only affects the module (or block) in which its located.