http://www.perlmonks.org?node_id=979026


in reply to Re^2: moose role that uses a class that does the role
in thread moose role that uses a class that does the role

What if you made the role parametric in one way or another? The role could require the presence of a method (created_class_name()) which Group could provide and, in this case, returns only the string 'Group'. That would decouple the class and the role, at least in the code you've shown here.

Another approach is to use MooseX::Role::Parameterized and pass in the class name when you compose the role.


Improve your skills with Modern Perl: the free book.