fetch_attrs#
Return the built-in attributes currently set on a referent.
Synopsis#
my @attrs = attributes::_fetch_attrs(\&foo);
What you get back#
A list of attribute names drawn only from the built-in set. For a CODE
referent that list can contain lvalue and method. For any other
referent the list is empty. User-defined attributes are not consulted
here; use get for that.
Examples#
sub s :lvalue :method { $x }
my @a = attributes::_fetch_attrs(\&s); # ('lvalue', 'method')
my $h = {};
my @a = attributes::_fetch_attrs($h); # ()
Edge cases#
Called with the wrong number of args or a non-reference: croaks with
Usage: attributes::_fetch_attrs($reference).Order is fixed:
lvaluebeforemethodwhen both are set.
Differences from upstream#
Fully compatible with upstream.
See also#
get— public wrapper that also callsFETCH_${type}_ATTRIBUTES._modify_attrs— write-side counterpart.