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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With