PPI::Token(3)
π PPI::Token β bestie edition π
okay so this is PPI::Token(3), straight out of the User Contributed Perl Documentation, and it's genuinely one of the cutest little building blocks in the whole PPI universe. let's get into it π«Ά
β¨ NAME β¨
PPI::Token β a single token of Perl source code. like, one lil guy. one atom of your code. iconic behavior honestly πΈ
π INHERITANCE π
the family tree goes like this:
PPI::Token
isa PPI::Element
so yes, a Token is a PPI::Element. it's giving "I inherited my whole personality from my parent class" and honestly? slay π
π¦ DESCRIPTION π¦
PPI::Token is the abstract base class for all Tokens. abstract meaning you don't really instantiate it directly, it's the blueprint, the vibe, the template. the way that every other Token class is like "yes I am one of these" π
in PPI terms, a Token is a PPI::Element that directly represents bytes of source code. like, actually literally the characters. the raw text. no cap πβ¨
π METHODS π
π set_content $string
the set_content method lets you set / change the string that the PPI::Token object represents. you're basically telling it "bestie, this is what you are now" π₯
Returns the string you set the Token to.
π add_content $string
the add_content method lets you tack on additional bytes of code onto the end of the Token. like adding a lil accessory to an already perfect outfit π
Returns the new full string, after the bytes have been added.
π length
the length method returns the length of the string in a Token. that's it. that's the whole method. simple, elegant, underrated π
π SUPPORT π
see the support section in the main module. (go check it out, it's right there, iykyk π§)
π AUTHOR π
Adam Kennedy <adamk@cpan.org> β actual legend, fr fr π
π 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.
π«Ά reminder bestie: it's abstract, so don't go trying to use PPI::Token directly, that's not the move. the subclasses are the main characters here π
and that's the whole page!! brought to you by perl v5.42.0, dated 2026-01-17, and this lil manpage has been serving PPI::Token(3) energy the entire time. mwah, no notes πβ¨π
π¦ 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