develooper Front page | perl.perl5.porters | Postings from April 2007

Re: [Andreas J. Koenig] C3 MRO breaks Params::Util and Graph

Thread Previous | Thread Next
Joshua ben Jore
April 23, 2007 23:16
Re: [Andreas J. Koenig] C3 MRO breaks Params::Util and Graph
Message ID:
On 4/23/07, Brandon Black <> wrote:
> This in turn has lead to another problem.  The "require Scalar::Util"
> in breaks ext/Dynaloader/t/Dynaloader.t, because it raises
> some count of loaded xs modules by one during two of the tests.
> Dynaloader itself is fine, its just that the new require line is
> breaking one of its test assumptions, and I didn't see a clean fix for
> that right now, and I'm heading to bed.

Your use of blessed() is dodgy. If you are going to call blessed()
then you should not be treating its return value as a boolean. Only
defined/undefined tells you if your argument is an object or not.
There are two packages in perl which objects may be blessed into that
are also false. Further, once you've gone to the trouble to use
blessed(), you might as well use the value instead of just calling
ref() a couple more times.

Now hold still a second while I bless you for doing this per-package
isa cache stuff (also also slightly curse you for changing this stuff
so my cache-watching code is invalid).


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About