Skip to content

Instantly share code, notes, and snippets.

@sschober
Created February 3, 2014 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sschober/8784886 to your computer and use it in GitHub Desktop.
Save sschober/8784886 to your computer and use it in GitHub Desktop.
RoleA requiring method provided by RoleB - Moo-Version (works)
use Moops;
role RoleA {
requires 'm1';
method m2() {
$self->m1." World!\n";
}
}
role RoleB {
has 'm1' => ( is => 'ro', isa => 'Str', default => 'Hello');
}
class ClassA
with RoleB
with RoleA {
method m3() {
$self->m2();
}
}
print ClassA->new()->m3();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment