I'm not sure I understand the question. Maybe this code example is what you're looking for?
This is documented in attributes under "Package-specific Attribute Handling".use strict; use List::Extract 'extract'; sub MODIFY_CODE_ATTRIBUTES { my $class = shift; my ($cref, @attrs) = @_; my ($bent) = extract { /^Bent\b/ } @attrs; if (defined $bent) { print "Recognized attribute: $bent\n"; } return @attrs; # Unrecognized. } sub foo :Bent; sub bar :Bent(named) { 1 } my $code = sub :Bent(anonymous) { 1 } __END__ Recognized attribute: Bent Recognized attribute: Bent(named) Recognized attribute: Bent(anonymous)
What to do once a subroutine attribute is recognized is a completely different story. :-)
lodin
In reply to Re: Sub attributes
by lodin
in thread Sub attributes
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |