attrsSection: Perl Programmers Reference Guide (3)Updated: 2001-09-21 |
attrsSection: Perl Programmers Reference Guide (3)Updated: 2001-09-21 |
sub foo {
use attrs qw(locked method);
...
}
@a = attrs::get(\&foo);
sub foo : locked method { }
to declare attributes instead. See also attributes.
This pragma lets you set and get attributes for subroutines. Setting attributes takes place at compile time; trying to set invalid attribute names causes a compile-time error. Calling "attrs::get" on a subroutine reference or name returns its list of attribute names. Notice that "attrs::get" is not exported. Valid attributes are as follows.