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 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