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 π
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
- fedora 44: perl-PPI 1.284-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms