attrs - set/get attributes of a subroutine |
attrs - set/get attributes of a subroutine (deprecated)
sub foo { use attrs qw(locked method); ... }
@a = attrs::get(\&foo);
NOTE: Use of this pragma is deprecated. Use the syntax
sub foo : locked method { }
to declare attributes instead. See also the attributes manpage.
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.
lock
operator immediately after the
subroutine is entered.
attrs - set/get attributes of a subroutine |