Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Roles don't "extend" classes. Subclasses extend classes. This will work:
... but if the constructor for class Foo is any more complicated than the above, you'll need to write a FOREIGNBUILDARGS method for Bar to tell Bar's constructor what argument need to be passed along to Foo's constructor.
use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
In reply to Re: Way to use Moo::Role to extend non-Moo class?
by tobyink
|
|