PPI::Token::Word(3)
π PPI::Token::Word(3) β the generic "word" Token π
okay bestie, welcome to PPI::Token::Word(3), aka the manual page you're reading right now, and honestly? it's giving foundational. no cap. this is the generic "word" Token and you're gonna be seeing it a LOT. πΈ
π¦ INHERITANCE π¦
the family tree, the lineage, the main character bloodline:
PPI::Token::Word
isa PPI::Token
isa PPI::Element
that's it, that's the ancestry. it inherits down the chain, as one does. periodt. π
β¨ DESCRIPTION β¨
so a PPI::Token::Word object is PPI's own special lil representation of several different types of word-like things, and it's genuinely one of the most common Token classes you'll find in typical documents. like, ubiquitous. everywhere. the it-girl of tokens. π
specifically (and this is important, don't skip it bestie), it covers not only barewords, but also:
- any other valid Perl identifier, including non-operator keywords and core functions
- and any include
"::"separators inside it
...as long as it fits the format of a class, function, etc. π«Ά
π METHODS π
here's the tea: there are no methods available for PPI::Token::Word beyond the ones provided by its PPI::Token and PPI::Element parent classes. that's the whole vibe.
but!! they expect to add additional methods over time, to help further resolve a Word as a function, method, etc. so watch this space ig. π
if you need such a thing right now, go look at Perl::Critic::Utils. slay, go get your answers elsewhere.
literal π€
returns the value of the Word as a string.
heads up bestie, this assumes (often incorrectly) that the Word is a bareword and not a function, method, keyword, etc. so like... vibe check it before you trust it. π
this differs from "content" because "Foo'Bar" expands to "Foo::Bar". iconic behavior, honestly. β¨
method_call π
answers whether this is the name of a method in a method call.
- returns true if yes
- returns false if no
- and returns nothing if unknown π
mysterious. enigmatic. we love a token that keeps us guessing.
π TO DO π
- Add
"function","method"etc detector methods
yeah. it's on the list. someday. π
π«Ά SUPPORT π«Ά
see the support section in the main module. that's the whole thing, bestie, iykyk. π
π 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.
lowkey a whole legal moment but we respect it fr fr π
okay that's the page!! mwah, go forth and tokenize π
β¨ this was perl v5.42.0, dated 2026-01-17, and yes, you were reading PPI::Token::Word(3) the entire time β iconic of you, honestly π§π
π¦ 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