NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Just because I don't know... (Score:1)
We're also assuming that the user of Role1 and Role2 has control over those roles.
What if I want to use Role1 from AuthorA and Role2 from AuthorB, and both roles have an update() method?
How do I resolve that? Even still, at least the problem will be up front.
Re:Just because I don't know... (Score:2)
If AuthorA and AuthorB are separate classes, just use the correct roles and exclude the methods you don't want. If they're separate instances, use runtime role application:
That's a little ugly, but it's safer than not checking for the use of the role. If you know that the role(s) will only be applied at runtime once and only once, you can skip the does_role check.
Reply to This
Parent