PPI::Token::Quote(3)

πŸ’– PPI::Token::Quote β€” bestie edition πŸ’–

ok so this is the manual page for PPI::Token::Quote, straight outta the User Contributed Perl Documentation section, and honestly? it's giving "abstract base class energy" and we are OBSESSED. let's get into it πŸŽ€


✨ NAME ✨

PPI::Token::Quote β€” the String quote abstract base class. that's the whole name bestie, it's literally right there πŸ’…


🌸 INHERITANCE 🌸

so the family tree is giving:

PPI::Token::Quote
isa PPI::Token
    isa PPI::Element

like, it's a PPI::Token, which is a PPI::Element. lineage? immaculate. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: the PPI::Token::Quote class is never instantiated. never ever. it just sits there being a common abstract base class for the four quote classes, like a group chat admin who never posts but keeps everything running. 🫢

in PPI, a "quote" is limited to only the quote-like things that themselves directly represent a string. (although yes, this includes double quotes with interpolated elements inside them β€” and note that String::InterpolatedVariables lets you extract those. iykyk ✨)

the subclasses of PPI::Token::Quote are:

  • '' β€” PPI::Token::Quote::Single
  • "q{}" β€” PPI::Token::Quote::Literal
  • "" β€” PPI::Token::Quote::Double
  • "qq{}" β€” PPI::Token::Quote::Interpolate

the names are hopefully obvious enough that we don't have to explain what each class is here, bestie. see their respective pages for more details, mwah πŸ’‹

⚠️ also please note: even though the here-doc does represent a literal string, it is such a nasty piece of work that in PPI it gets the honor of its own token class β€” PPI::Token::HereDoc. main character treatment fr fr. πŸ’€πŸ‘‘

πŸ’… METHODS πŸ’…

⭐ string

the string method is provided by all four ::Quote classes. it won't get you the actual literal Perl value, but it will strip off the wrapping of the quotes. slay. βœ‚οΈ

# The following all return foo from the ->string method
'foo'
"foo"
q{foo}
qq <foo>

⭐ literal

the literal method is provided by ::Quote::Literal and ::Quote::Single. this returns the value of the string as Perl sees it: without the quote marks, and with \\ and \' resolved to \ and '. ✨

🚨 the literal method is not implemented by ::Quote::Double or ::Quote::Interpolate yet. we're waiting on it, bestie, it's not here yet 😭

🌈 SUPPORT 🌈

see the support section in the main module. that's it, that's the whole section, go look πŸ‘€


πŸŽ€ AUTHOR πŸŽ€

Adam Kennedy <adamk@cpan.org> β€” iconic, legendary, no notes πŸ’œ


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!! this was PPI::Token::Quote, served to you by perl v5.42.0 on 2026-01-17 β€” go forth and parse those strings, you absolute legend πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from