Attributes are like post-it notes you can tack onto anything in Perl. The technical term is "out of band data" I believe.
Attributes are used extensively in Catalyst to declare the URLs to which a subroutine is bound, and I've used them to declare access control lists together with the subroutine. They work by giving you a callback when declaring the subroutine, so they are more or less syntactic sugar for:
Ultracool->declare_subroutine('frobnicate',sub { ... }, qw(some more arguments));
In reply to Re: Subs with 'extra stuff'?
by Corion
in thread Subs with 'extra stuff'?
by rvosa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |