in reply to Arcane syntax question (Catalyst/OOPerl)

That syntax declares an attribute. I'm not sure where they are discussed in the Perl documentation - maybe only within the attributes pragma.

If you want to learn how you can (ab)use attributes yourself, Attributes::Handlers is the best wrapper I guess.

  • Comment on Re: Arcane syntax question (Catalyst/OOPerl)

Replies are listed 'Best First'.
Re^2: Arcane syntax question (Catalyst/OOPerl)
by bitstream (Sexton) on Feb 06, 2006 at 22:49 UTC
    Excellent. So the attributes can gain knowledge of function invocation before they actually are invoked, and (in this case) potentially intercept/deny/replace them? I think?

    I see where in "perldoc attributes" the syntactic sugar maps the colon syntax into the "use attributes" syntax, though I didn't see an example of actually writing a custom attribute without Attribute::Handlers. This omission is probably ok as I can read the source there.

    I can definitely see AOP-style implications. Or maybe I'm missing the point here?

      Catalyst uses these for metadata about methods. It maps URLs to methods using this data.