How can I access the meta class of the module my Moose role is being applied to?
问题 I'm using Moose roles to apply some wrapper behaviour around some accessor methods in a class. I want to apply this role to a number of modules, each of which have a different set of attributes whose accessors I want to wrap. Is there a way to access the meta class of the module being applied to, from within the role? i.e. something like this: package My::Foo; use Moose; with 'My::Role::X'; has [ qw(attr1 attr2) ] => ( is => 'rw', # ... ); has 'fields' => ( is => 'bare', isa => 'ArrayRef[Str]