Skip Menu |
 

This queue is for tickets about the UNIVERSAL-can CPAN distribution.

Report information
The Basics
Id: 63771
Status: open
Priority: 0/
Queue: UNIVERSAL-can

People
Owner: Nobody in particular
Requestors: norbi [...] nix.hu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.16
Fixed in: (no value)



Subject: Triggers overload on blessed invocants
Download (untitled) / with headers
text/plain 598b
Internally UNIVERSAL::can::can() calls ->isa() on the invocant, and UNIVERSAL::isa() (the built-in) triggers overloads on its argument - which is really bad if that overload method is costly (eg. DBIx::Class::ResultSet has a numeric conversion overload that performs a count(*) on the resultset..). I guess there are not many modules that intentionally stringify to the name of some class so that to keep UNIVERSAL::isa() happy, so this should not break much code. See https://github.com/mendel/UNIVERSAL-can/commit/41fa395c0b5a51766d8c5ecc9fdc412def42059d for the patch (incl. a test, of course).
Download (untitled) / with headers
text/plain 154b
This seems like a straightforward bug with a straightforward fix, including patch and test. Is there any reason not to apply it? (Also, it bit me today.)
Thanks, commit pulled from Github and released as 1.20110613.
Download (untitled) / with headers
text/plain 1.4k
On Sun Jun 12 18:32:56 2011, CHROMATIC wrote: Show quoted text
> Thanks, commit pulled from Github and released as 1.20110613.
This doesn't really sound like the same issue, but I ran into this problem (repro case below), which was solved by the patch in this bug (proven by reverting just those two lines, which reproduced the bug again): --8< snip-- use strict; use warnings; use UNIVERSAL::can; use UNIVERSAL::isa; use TryCatch; sub foo { try { print "some code goes here\n"; } catch ($e) { print "some code goes here\n"; } } __END__ # if UNIVERSAL::isa is included: Use of uninitialized value in goto at /usr/lib/perl5/site_perl/5.8.8/UNIVERSAL/isa.pm line 76. Use of uninitialized value in goto at /usr/lib/perl5/site_perl/5.8.8/UNIVERSAL/isa.pm line 76. Use of uninitialized value in goto at /usr/lib/perl5/site_perl/5.8.8/UNIVERSAL/isa.pm line 76. Use of uninitialized value in goto at /usr/lib/perl5/site_perl/5.8.8/UNIVERSAL/isa.pm line 76. # and if it isn't: Use of uninitialized value in subroutine entry at /usr/lib/perl5/site_perl/5.8.8/UNIVERSAL/can.pm line 43. Use of uninitialized value in subroutine entry at /usr/lib/perl5/site_perl/5.8.8/UNIVERSAL/can.pm line 43. Use of uninitialized value in subroutine entry at /usr/lib/perl5/site_perl/5.8.8/UNIVERSAL/can.pm line 43. Use of uninitialized value in subroutine entry at /usr/lib/perl5/site_perl/5.8.8/UNIVERSAL/can.pm line 43. -->8 snip-- So, thank you! :)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.