Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: I don't care about *your* warnings!

by adrianh (Chancellor)
on Mar 01, 2007 at 14:48 UTC ( #602695=note: print w/ replies, xml ) Need Help??


in reply to I don't care about *your* warnings!

First, I'm curious as to why I'm seeing these warnings

You're seeing them because (under the hood) Test::Class is doing:

eval { Contextual::Return::Value->isa( 'SomeOtherClass' ) }

and Contextual::Return::Value::AUTOLOAD isn't written with autoloading class methods in mind and assuming that its first argument is a reference. I've submitted an RT ticket. I might tweak T::C to avoid this, but I think this is really C:R:V's fault :-)

Is there any way for me to essentially turn warnings off for Contextual::Return, short of making a local copy and commenting it out?
$SIG{ __WARN__ } = sub { return if caller eq 'Contextual::Return::Value'; warn @_; };


Comment on Re: I don't care about *your* warnings!
Select or Download Code
Re^2: I don't care about *your* warnings!
by adrianh (Chancellor) on Mar 01, 2007 at 16:53 UTC
    I might tweak T::C to avoid this
    0.24 on its way to CPAN now avoids these warnings, and has a bug fix to boot :-)
Re^2: I don't care about *your* warnings!
by agianni (Hermit) on Mar 01, 2007 at 19:49 UTC

    Actually, I talked with Damian, and he put together a patch for Contextual::Return that seems to take care of it as well. Before that patch, and with an earlier version of T::C (before you wrapped the isa call with the eval) it used to create a fatal error when Contextual::Return was loaded.

    BTW, Test::Class has made my testing soooo much easier and the improvements over the past several months have made it that much more useful. I highly recommend it for testing, especially for large modules and applications.

      BTW, Test::Class has made my testing soooo much easier and the improvements over the past several months have made it that much more useful. I highly recommend it for testing, especially for large modules and applications.

      Flattery gets you everywhere :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://602695]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-08-29 05:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls