On 3/7/10 9:52 PM, Tomas Doran wrote:
On 5 Mar 2010, at 16:29, Jesse Luehrs wrote:
Yes, those are for Moose attributes (has foo => (...)). To introspect
methods, you want get_all_methods, and if you want to be able to see sub
attributes with this, you want MooseX::MethodAttributes.
But before you do this I caution you to think twice.
attributes in perl are horrible to use and parse. MX::MethodAttributes
just shoves the information into the metaclass, and makes no attempt
to solve this problem.
What are you trying to do that requires attributes, and why wouldn't
it be clearer (and probably more flexible) to provide some declarative
sugar yourself instead?
Cheers
t0m
Actually, I'm just trying to learn. I was looking at Catalyst and
wanted to see if I could emulate its dispatcher (as an educational
exercise) before looking at the actual code.
I've never used method attributes in practice, but I wanted to
understand them better so I can be up-to-date with the state of the Perl
art =)
-Sir