>> 
>> I am using an ORM, which creates methods for my class using globs, in place.
>> 
>> e.g.  __PACKAGE__->has_a('foo'...);
>> 
> 
> Class::MOP (and so Moose) recognizes methods as code symbols in a
> package that also have a valid subname (as with Sub::Name). This is
> because methods declared with the 'sub' keyword automatically get the
> appropriate subname, and functions exported into your package by
> assigning to globs don't, and so function exports (from things like
> Try::Tiny, List::Util, etc) don't get seen as methods. If you're using
> something that's actually intending to export methods, you'll have to
> add the subname yourself, either (as Moose does) by doing it inside the
> exporter, like
> 
>  use Sub::Name;
>  *foo = subname 'foo' => sub { ... };
> 
> or I believe you can also add a subname after the fact with something
> like
> 
>  use Sub::Name;
>  subname 'foo', \&foo;
> 
> although I'm not entirely sure about that one.
> 
> 

Wow, this is interesting.  I am guessing, I can subclass & modify the ORM to 
use this method of creating methods.  I'll give it a try. Thanks!


Reply via email to