I would like to use Moo instead of Moose, but I also need to inherit from non-Moose classes. How should I deal with that? Is there a module to work around this? If not, is there a way I can handle it myself?
1 Answer
Moo can handle subclassing non-Moo/Moose classes already. You don't need an extension.
See the documentation for FOREIGNBUILDARGS, which states:
If you are inheriting from a non-Moo class, the arguments passed to the parent class constructor can be manipulated by defining a FOREIGNBUILDARGS method. It will receive the same arguments as BUILDARGS, and should return a list of arguments to pass to the parent class constructor.
-
2If the parent class isn't hash based, you might need MooX::InsideOut Commented Dec 18, 2014 at 18:25