On 03/10/2010 04:50 AM, Jesse Luehrs wrote:
On Tue, Mar 09, 2010 at 02:48:14PM -0500, Sir Robert Burbridge wrote:
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 =)
Tomas's point was that method attributes are not the state of the Perl
art(: They're an annoying and ugly hack that Catalyst keeps around
pretty much just because changing how all of that works now would be a
pretty huge pain (considering back compat and such).
-doy
Fair enough =) But they're a part of perl (and a part in usage). It
may turn out to be an ugly part of the State, but it's still there and I
want to understand it so that I can decide not to use it for the right
reasons, instead of the wrong ones!
-Sir