[Chicago-talk] Undefined subroutine Class::MOP::Mixin::HasMethods::wrap/body errors

Sean Blanton sean at blanton.com
Mon Feb 7 07:52:27 PST 2011

Hi All,

I just upgraded from perl 5.10 to v5.12.2 (Fedora 13->14) and am getting the
following errors in several classes. I'm hoping someone can give me some
high level pointers before I go under the covers to examine the private

> Undefined subroutine &Class::MOP::Mixin::HasMethods::wrap called at
/usr/local/lib64/perl5/Class/MOP/Mixin/HasMethods.pm line 165.

> Undefined subroutine &Class::MOP::Mixin::HasMethods::body called at
/usr/local/lib64/perl5/Class/MOP/Mixin/HasMethods.pm line 165.

which occurs in:
sub remove_method {
    my ( $self, $method_name ) = @_;
    ( defined $method_name && length $method_name )
        || confess "You must define a method name";

****->    my $removed_method = delete

        { sigil => '&', type => 'CODE', name => $method_name } );


I'm not getting a stack trace, which I feel must somehow be my fault, but I
normally do get a stack trace. Eclipse tells me the parent class where the
error occurs, but it can only give me the message that Perl produces above.

My Moose et al. versions went from:

Moose  0.99 -> 1.17
Moose::Meta::Role 0.99 -> 1.17
Class::MOP 0.98 -> 1.10
Class::MOP::Mixin::HasMethods 0.98 -> 1.10

In one case, I found by removing a method in a role that was overriden by
it's consuming class cleared the ::body method error, but I haven't found
common traits with other classes having the same error.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20110207/ac5e37a3/attachment.html>

More information about the Chicago-talk mailing list