in reply to Re: Re: How to stack a call to a class method
in thread How to stack a call to a class method

Yes true. And in fact if you had done a search on warnings::warnif() you probably would have found many more hits. Thanks for the correction.

Although I didnt articulate this, what I was thinking of was that all output from warnings.pm are reported through CORE::warn() and CORE::die() (via Carp.pm) so overriding them (globally) or setting $SIG{__WARN__} and $SIG{__DIE__} to preprocess their arguments should resolve all user generated messages. The latter actually allows you to intercept Perl generated exceptions. Although in the case of a die() that won't be useful for much beyond changing the error message.

---
demerphq


Replies are listed 'Best First'.
Re: Re: Re: Re: How to stack a call to a class method
by belden (Friar) on Mar 08, 2003 at 18:15 UTC
    ++demerphq

    Thanks for the update. Yesterday a co-worker asked me how to turn off warnings that a module was generating during the course of his testing. (The warnings were of the sort "warning, you're running in test mode, DB will not be updated")

    During the test, he doesn't want to see the warnings. But during a live run, he would want to see them show up in the log. We played around unsuccessfully with having the test program install a new warnings::warn, CORE::warn, and even installing a warn in the package that was being tested. No dice.

    $SIG{__WARN__} sounds like exactly what we want; I'll have to hit that bit of the cookbook a bit more ;)

    blyman
    setenv EXINIT 'set noai ts=2'