Subject: | Unhelpful err msg when consumer and role have same sub |
Getting this error message a Moose class consumes a role and both the
class and the role have a sub with the same name:
Undefined subroutine &Class::MOP::Mixin::HasMethods::body called at
/usr/local/lib64/perl5/Class/MOP/Mixin/HasMethods.pm line 165.
There is no normal Moose stack trace, only this message referring to the
Class::MOP line #. It is a very mysterious message and when you are
flying through code reorg and re-factoring, it stops you dead.
Fortunately I now recognize the message, but the first time it took me
literally an hour to figure out which module had the problem and what the
problem was.
Moose is awesome - thanks!