in reply to Moose Roles and Override
Explained in
Method Conflicts
and in the following section "Method Exclusion and aliasing".
package top; use Moose::Role; requires 'token'; sub foo { print "foo\n"; } package bottom; use Moose::Role; with 'top' => { -alias =>{ foo => '_foo', }, -excludes => [ 'foo' ], }; sub foo { print "bar\n"; } package something; use Moose; with "bottom"; sub token { print "I don't want to implement token untill the concerete class +but I want to use bottom's version of foo\n"; } package main; my $something = new something; $something->foo;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Moose Roles and Override
by edwinorc (Novice) on Feb 08, 2012 at 08:16 UTC |
In Section
Seekers of Perl Wisdom