Please fracking make this go away.
t/storage_validate_data...................Called UNIVERSAL::can() as a function, not a method at C:/strawberry-perl/perl/site
I don't care who's fault it is, but it isn't mine. Now stop pissing in my pool just because I'm mock testing and UNIVERSAL::JAMMYRELIGIONINYOURFACE is loaded.
That is all.
What that is... (Score:1)
DateTime::Locale needs to call stuff as a method, not a function.
Re: (Score:1)
All too true, but given the lack of willingness of some CPAN authors to fix bugs in their modules, I plan to release new versions of UNIVERSAL::isa and UNIVERSAL::can which only give those warnings for code that calls them for modules which use both modules directly.
I should have time to work on that this weekend.
Re: (Score:2)
Re: (Score:1)
If you can trigger that false positive in a test case, I'll add it to the U::c/U::i suite and fix it.
Re: (Score:1)
Compare:
$ foo->isa('UNIVERSAL') and print "yes\n"
<nothing>
to
$ package foo;
$ foo->isa('UNIVERSAL') and print "yes\n"
yes
I think U::can might get upset in this case... but who knows.
Another possibility... didn't that line use can as a function in an older version of the module? I can't get the warning to happen with the latest DateTime::Locale, but I could about a year ago.
Re: (Score:1)
$ use UNIVERSAL::can;
$ UNIVERSAL->can('can') and print "can can\n";
can can
$ FOOBAR->can('can') or print "cannot can\n";
Called UNIVERSAL::can() as a function, not a method at (eval 59) line 5
cannot can
$ package FOOBAR;
$ FOOBAR->can('can') and print "now can can\n";
now can can
Re: (Score:2)
canis a way to check if the module has been loaded. It's quicker than blindly usingrequirein every case, I think.Re: (Score:1)
That's the problem then. Your heuristic for testing if a class exists fights with my heuristic for testing if a class exists. I suppose U::i/U::c could skim through the optree for a
methodormethod_namedopcode, but that's a lot more work.Re: (Score:2)
Re: (Score:1)
In fact you already have the necessary logic in UNIVERSAL::can to figure out whether the package is in the symbol table. Therefore the following patch looks like it should fix the problem:
---
+++ can.pm 2007-11-01
Re: (Score:1)
That smells like a really bad idea (Score:1)
Furthermore pity the poor programmer who has to figure out your code. Do you always put comments on your uses of that idiom? If not, then will it make sense to someone else that you're checki
Re: (Score:1)
I'll just go hide in a corner then.
Re: (Score:1)
Re: (Score:1)
UTS, L (Score:1)
Heh, we had the same long-time issues on a local box, and as we deemed it to be SEP, we commented out the warning message. The world has come to an end, so far :)
Re: (Score:1)
err, not come to an end, of course. (jeez I wish this software would let us edit comments -- that's the second time in a week).