chromatic wrote:
> On Tuesday 27 February 2007 13:42, Michael G Schwern wrote:
> 
>> This handily solves your stated purpose of warning the user about
>> MockObjects not being used because of UNIVERSAL::isa mistakes WITHOUT
>> warning the user about EVERY mistaken use of UNIVERSAL::isa.
> 
> $ perldoc perllexwarn

Yes I'm aware of that.  It is lexical thus I cannot say this to switch off
the warning for good:

        no warnings "UNIVERSAL::isa";
        use Test::MockObject;
        ...

I have to patch the code which is calling UNIVERSAL::isa() as a function.
Every instance of it in all the code I might use.  In the case of a CPAN
module it is not my code.  I might not even have write access to edit it.
Thus it provides no better option for the 3rd party user.

It is also the wrong solution when, in most cases, it actually is a mistake
to call UNIVERSAL::isa as a function.  It would be better to patch the code
(if I can and if I have the inclination) then to paper over it.

What is wrong with the proof-of-concept I proposed?

Reply via email to