I've hated it how ref() does the wrong thing so frequently so I wrote
a fix for it. I like to use mock objects to feed fake or proxy objects
to other things but this breaks when things not under my control use
ref() to examine the class of an object.

No longer. Under most circumstances ref() behaves normally. The only
time it lies is if you've requested it from a package and have a ref
method.

 print ref( bless [], 'PROXY' ); # I'm not a proxy!

 package PROXY;
 use UNIVERSAL::ref;
 sub ref { q[I'm not a proxy! }

I was going to send this just to chromatic because its his
Test::MockObject but then figured it'd be better to tell perl-qa about
it.

Josh

Reply via email to