in reply to Re^4: Is there a better way to do this?
in thread Is there a better way to do this?
Hi choroba,
That doesn't work for me. I had tried that because I knew that Moo::Role is based on Role::Tiny, but got an error:
Output:package MyClass; use Moo; #use Role::Tiny(); sub BUILD { my $self = shift; # Role::Tiny->apply_roles_to_package( __PACKAGE__, 'MyClass::Child' + ); 'Moo::Role'->apply_roles_to_package( __PACKAGE__, 'MyClass::Child' + ); return $self; }; sub foo { return 'foo'; } 1;
Can't locate object method "apply_roles_to_package" via package "Moo:: +Role" at MyClass.pm line 10.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Is there a better way to do this?
by choroba (Cardinal) on Mar 19, 2016 at 18:45 UTC | |
by 1nickt (Canon) on Mar 19, 2016 at 19:49 UTC |