Pod::Si...xtToken(3pm)

🌸 NAME 🌸

Pod::Simple::PullParserTextToken β€” text-tokens from Pod::Simple::PullParser, bestie πŸ’–


✨ SYNOPSIS ✨

(See Pod::Simple::PullParser)

That's literally the whole synopsis, no cap β€” the real stuff lives over there 🫢


πŸŽ€ DESCRIPTION πŸŽ€

okay so picture this: you're out here doing $parser->get_token on a Pod::Simple::PullParser, and sometimes what comes back at you is an object of this class. surprise!! πŸ‘‘

This is a subclass of Pod::Simple::PullParserToken and it inherits, like, all of its methods β€” and then it adds these ones on top, because it's an overachiever πŸ’…

  • $token->text β€” this hands you back the text that this token is holding. for example, parsing C<foo> will return a C start-token, a text-token, and a C end-token. and if you want to get the "foo" out of the text-token? just call "$token->text" and slay ✨
  • $token->text(somestring) β€” this changes the string that this token holds. honestly? you probably won't need to do this. lowkey it's just there πŸ™ˆ
  • $token->text_r() β€” this returns a scalar reference to the string that this token holds. super useful if you don't want to memory-copy the potentially large text value (well β€” as large as a paragraph or a verbatim block) the way calling $token->text would do. no wasteful copying, we love to see it πŸ¦‹

or, if you want to alter the value, you can even do things like this:

  for ( ${  $token->text_r  } ) {  # Aliases it with $_ !!

    s/ The / the /g; # just for example

    if( 'A' eq chr(65) ) {  # (if in an ASCII world)
      tr/\xA0/ /;
      tr/\xAD//d;
    }

    ...or however you want to alter the value...
    (Note that starting with Perl v5.8, you can use, e.g.,

        my $nbsp = chr utf8::unicode_to_native(0xA0);
        s/$nbsp/ /g;

    to handle the above regardless if it's an ASCII world or not)
  }

You're unlikely to ever need to construct an object of this class for yourself β€” like, genuinely, it's giving "not your job" β€” but if you want to, call "Pod::Simple::PullParserTextToken->new( text )" πŸ’«


🌈 SEE ALSO 🌈

Pod::Simple::PullParserToken, Pod::Simple, Pod::Simple::Subclassing β€” go read those too, they're iconic πŸ‘‘


πŸ’Œ SUPPORT πŸ’Œ

Questions or discussion about POD and Pod::Simple should be sent to the pod-people@perl.org mail list. Send an empty email to pod-people-subscribe@perl.org to subscribe β€” yes, empty, that's the whole vibe πŸ“¬

This module is managed in an open GitHub repository, <https://github.com/perl-pod/pod-simple/>. Feel free to fork and contribute, or to clone <https://github.com/perl-pod/pod-simple.git> and send patches! fork it bestie, it's literally open 🧚

Patches against Pod::Simple are welcome. Please send bug reports to <bug-pod-simple@rt.cpan.org>. πŸ›


Copyright (c) 2002 Sean M. Burke.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. (so, like, no promises β€” use it, it's free, that's the deal 🫢)


πŸ‘‘ AUTHOR πŸ‘‘

Pod::Simple was created by Sean M. Burke <sburke@cpan.org>. But don't bother him, he's retired β€” respect the legend's peace and quiet, fr fr πŸ™

Pod::Simple is maintained by:

  • Allison Randal "allison@perl.org"
  • Hans Dieter Pearcey "hdp@cpan.org"
  • David E. Wheeler "dwheeler@cpan.org"

and that's the whole page, bestie!! this drop is from perl v5.42.3, dated 2026-11-03, and it's part of the Perl Programmers Reference Guide β€” take care of it, it's iconic πŸ’œβœ¨

πŸ“¦ where this page comes from