Perl-Sensitive Sunglasses | |
PerlMonks |
Re: moose role that uses a class that does the roleby duelafn (Parson) |
on Jun 28, 2012 at 14:14 UTC ( [id://978945]=note: print w/replies, xml ) | Need Help?? |
I would guess that you really want to use requires in your role to require certain functionality of the consumer of your role (in this case Greeting) possibly combined with normal inheritance. For example:
Greeting:
Greeting2:
Greeting3 (uses the greet from Greeting):
Now your test script produces:
Update: Added script output. Also, I second tospo's suggestion to move all of the common functionality to the Hello role Good Day,
In Section
Seekers of Perl Wisdom
|
|