Lines Matching defs:attributes

1 package attributes;
22 # attributes for that type.
122 attributes - get/set subroutine or variable attributes
130 use attributes (); # optional, to get subroutine declarations
131 my @attrlist = attributes::get(\&foo);
133 use attributes 'get'; # import the attributes::get subroutine
145 use attributes __PACKAGE__, \&foo, 'method';
149 use attributes ();
151 attributes::->import(__PACKAGE__, \$x, 'Bent');
152 attributes::->import(__PACKAGE__, \@y, 'Bent');
153 attributes::->import(__PACKAGE__, \%z, 'Bent');
164 There are only a few attributes currently handled by Perl itself (or
166 package-specific attributes are allowed by an extension mechanism.
169 The setting of subroutine attributes happens at compile time.
170 Variable attributes in C<our> declarations are also applied at compile time.
171 However, C<my> variables get their attributes applied at run-time.
173 before those attributes will get applied. For example:
194 use attributes __PACKAGE__, \&foo, 'method';
196 As you might know this calls the C<import> function of C<attributes> at compile
197 time with these parameters: 'attributes', the caller's package name, the reference
200 attributes->import( __PACKAGE__, \&foo, 'method' );
205 C<attributes.pm> checks if there is a subroutine called C<< MODIFY_<reftype>_ATTRIBUTES >>
213 C<< MODIFY_<reftype>_ATTRIBUTES >> has to return a list of all "bad attributes".
214 If there are any bad attributes C<import> croaks.
220 The following are the built-in attributes for subroutines:
267 The following are the built-in attributes for variables:
288 subroutine or variable. It returns a list of attributes, which may be
294 Otherwise, only L<built-in attributes|"Built-in Attributes"> will be returned.
312 for applying package attributes to 'cloned' copies of subroutines used as
319 (or its @ISA inheritance tree). Similarly, when C<attributes::get> is
325 declared or of the reference passed. Because these attributes are
339 attributes are desired. The expected return value is a list of
340 associated attributes. This list may be empty.
345 attributes from the relevant declaration. The two fixed arguments are
347 variable. The expected return value is a list of attributes which were
349 to delegate a call to its base class, and then only examine the attributes
359 Calling C<attributes::get()> from within the scope of a null package
363 attributes. A named subroutine knows to which symbol table entry it belongs
411 as to how they resolve internally into C<use attributes> invocations by
414 attributes.
428 use attributes ();
429 attributes::->import(Canine => \$spot, "Watchful");
440 use attributes ();
441 attributes::->import(Felis => \$cat, "Nervous");
452 use attributes X => \&foo, "lvalue";
463 use attributes Y => \&Y::x, "lvalue";
480 use attributes X => \&X::foo, "lvalue";
485 be trying to mess with the attributes of something in a package that's
510 these "bad attributes".