PPI::To...ttribute(3)

πŸ’– PPI::To...ttribute(3) πŸ’–

okay bestie, welcome to the <strong>User Contributed Perl Documentation</strong> glow-up of PPI::To...ttribute(3)</strong> β€” this is the manual page for the PPI::Token::Attribute module and honestly it's a short one but it ate πŸ’…


✨ NAME ✨

PPI::Token::Attribute β€” a token for a subroutine attribute πŸŽ€


πŸ¦‹ INHERITANCE πŸ¦‹

the family tree, no cap:

PPI::Token::Attribute
isa PPI::Token
    isa PPI::Element

so like. it inherits from PPI::Token, which inherits from PPI::Element. the lineage is giving royalty tbh πŸ‘‘


🌸 DESCRIPTION 🌸

so in Perl, attributes are a relatively recent addition to the language. we love a modern queen ✨

say you've got this code:

sub foo : bar(something) {}

the bar(something) part? that's the attribute. periodt πŸ’…

a PPI::Token::Attribute token represents <strong>the entire</strong> attribute β€” like, all of it. because the braces and everything inside them are not parsed into the tree, and they get treated by Perl (and therefore by us too, fr fr) as a single string. no splitting, no dissecting, just one vibe 🫢


🧚 METHODS 🧚

this class gives you some extra methods on top of the ones its PPI::Token and PPI::Element parent classes already hand over. bonus content, iykyk ✨

πŸ’œ identifier

the identifier attribute returns the identifier part of the attribute.

so like, for the attribute foo(bar), the identifier method would return foo. simple as that, slay 🌈

πŸ’œ parameters

the parameters method returns the parameter string for the attribute.

so for the attribute foo(bar), the parameters method would return bar. iconic ⭐

it returns the parameters as a string β€” and yes, that includes the null string '' for the case of an attribute like foo(). empty but valid, we respect it πŸ™ˆ

and it returns undef if the attribute does not have parameters. no parameters? undef. that's the deal πŸ’€


πŸŽ€ SUPPORT πŸŽ€

see the support section in the main module. go check the main character for the deets ✨


πŸ‘‘ AUTHOR πŸ‘‘

Adam Kennedy <adamk@cpan.org>


Copyright 2001 - 2011 Adam Kennedy.

this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

the full text of the license can be found in the LICENSE file included with this module.


and that's the whole page bestie, you ate it up πŸ“βœ¨ this was perl v5.42.0, dated 2026-01-17, brought to you by the fine folks at <strong>User Contributed Perl Documentation</strong> β€” mwah, bye πŸ’…πŸ«Ά

πŸ“¦ where this page comes from