Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jk2addict (4946)

jk2addict
  (email not shown publicly)
http://today.icantfocus.com/blog/
AOL IM: chrislaco (Add Buddy, Send Message)
Yahoo! ID: chrislaco@sbcglobal.net (Add User, Send Message)
Jabber: laco@scribblewerks.com

Journal of jk2addict (4946)

Wednesday October 04, 2006
12:39 PM

When modules collide

[ #31218 ]

After installing a copy of strawberry perl and running Handel tests under that, I started getting prototype mismatch warnings that I never received under older versions:

t\subclassing.............................ok 1/68Prototype mismatch: sub Handel::Checkout::except (&;$) vs none at C:/strawberry-perl/perl/site/lib/Module/Pluggable.pm line 67.

I was stumped for a while, then I remembered this post by Ovid and the answer hit me.

use Module::Pluggable;
use Error ':try';

I completely forget that Error has an except block. They're both competing for except(). Duh. M::P creates an except on the fly, and the :try tag tells Error to export it's except(). Changing Error to import just try/catch/with solved the problem. If I wanted to use Errors' except(), who knows how that would work.

I stared at the M::P code for the longest time trying to figure out where the prototype declaration was. Go figure.

What has me curious is that this warning apparently only happens in 5.8.8 and not previous versions. Must have something to do with anon subs added on the fly after at compile time.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • There was a bug fix with warnings in 5.8.8 that might be related. From 'perldoc perl588delta':

      no warnings 'category' works correctly with -w
        Previously when running with warnings enabled globally via "-w",
        selective disabling of specific warning categories would actually turn
        off all warnings. This is now fixed; now "no warnings 'io';" will only
        turn off warnings in the "io" class. Previously it would erroneously
        turn off all warning

    • selective disabling of specific warning categories would actually turn off all warnings

      Nasty!!

  • Inevitably you have to use it fully referenced...

    Error::try { ...
    };
    And so on, rather than using them as exported symbols.