Uh... yeah, maybe.

Reading warnings.pm's &import is revealing. Appears the current
package doesn't matter at all - it just writes to ${^WARNING_BITS}
which is global because it is one of those ${^...} variables.

I dunno. I guess if I knew this B::Hooks thing I could answer
reasonably. It's likely just a story of making sure you're writing to
the variable at the right time. Might not be sufficient hook to get it
then or this Hooks thing is the wrong time.

Josh

On 6/27/09, Hans Dieter Pearcey <hdp.perl....@weftsoar.net> wrote:
> On Sat, Jun 27, 2009 at 08:46:12AM -0700, Joshua ben Jore wrote:
>> Without reading B::Hooks::OP::blah to know how it works, I notice
>> you're calling import from the forcewarn package, not the package you
>> want to affect. Consider:
>>
>> eval "
>>     package $target_package;
>>     warnings->import( FATAL => 'all' );
>> "
>>
>> instead. Also, you should require warnings if you're going to call a
>> method on it. I know you probably already have it loaded but it's good
>> practice.
>
> Since the effect of warnings->import is lexical, this won't do anything,
> will
> it?
>
> hdp.
>

Reply via email to