in reply to Can a Moose Role access & modify the metaclass of classes into which it's composed?
It can be done. Let's imagine your role is called YourRole. Now, YourRole->meta returns an object referred to a the metarole. Let's call that $metarole. What you want to do is apply a trait to $metarole what adds an after modifier to the apply method.
In that modifier you should be able to figure out what class the role is being composed with, and do stuff with that class.
That said, stvn does read PerlMonks occasionally, and may know of a better way.
|
|---|