| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "Pod::Simple::PullParserTextToken 3perl" |
| 58 |
.TH Pod::Simple::PullParserTextToken 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
Pod::Simple::PullParserTextToken \-\- text\-tokens from Pod::Simple::PullParser |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
(See Pod::Simple::PullParser) |
| 68 |
.SH DESCRIPTION |
| 69 |
.IX Header "DESCRIPTION" |
| 70 |
When you do \f(CW$parser\fR\->get_token on a Pod::Simple::PullParser, you might |
| 71 |
get an object of this class. |
| 72 |
.PP |
| 73 |
This is a subclass of Pod::Simple::PullParserToken and inherits all its methods, |
| 74 |
and adds these methods: |
| 75 |
.ie n .IP $token\->text 4 |
| 76 |
.el .IP \f(CW$token\fR\->text 4 |
| 77 |
.IX Item "$token->text" |
| 78 |
This returns the text that this token holds. For example, parsing |
| 79 |
C<foo> will return a C start-token, a text-token, and a C end-token. And |
| 80 |
if you want to get the "foo" out of the text-token, call \f(CW\*(C`$token\->text\*(C'\fR |
| 81 |
.ie n .IP $token\->text(\fIsomestring\fR) 4 |
| 82 |
.el .IP \f(CW$token\fR\->text(\fIsomestring\fR) 4 |
| 83 |
.IX Item "$token->text(somestring)" |
| 84 |
This changes the string that this token holds. You probably won't need |
| 85 |
to do this. |
| 86 |
.ie n .IP $token\->\fBtext_r()\fR 4 |
| 87 |
.el .IP \f(CW$token\fR\->\fBtext_r()\fR 4 |
| 88 |
.IX Item "$token->text_r()" |
| 89 |
This returns a scalar reference to the string that this token holds. |
| 90 |
This can be useful if you don't want to memory-copy the potentially |
| 91 |
large text value (well, as large as a paragraph or a verbatim block) |
| 92 |
as calling \f(CW$token\fR\->text would do. |
| 93 |
.Sp |
| 94 |
Or, if you want to alter the value, you can even do things like this: |
| 95 |
.Sp |
| 96 |
.Vb 1 |
| 97 |
\& for ( ${ $token\->text_r } ) { # Aliases it with $_ !! |
| 98 |
\& |
| 99 |
\& s/ The / the /g; # just for example |
| 100 |
\& |
| 101 |
\& if( \*(AqA\*(Aq eq chr(65) ) { # (if in an ASCII world) |
| 102 |
\& tr/\exA0/ /; |
| 103 |
\& tr/\exAD//d; |
| 104 |
\& } |
| 105 |
\& |
| 106 |
\& ...or however you want to alter the value... |
| 107 |
\& (Note that starting with Perl v5.8, you can use, e.g., |
| 108 |
\& |
| 109 |
\& my $nbsp = chr utf8::unicode_to_native(0xA0); |
| 110 |
\& s/$nbsp/ /g; |
| 111 |
\& |
| 112 |
\& to handle the above regardless if it\*(Aqs an ASCII world or not) |
| 113 |
\& } |
| 114 |
.Ve |
| 115 |
.PP |
| 116 |
You're unlikely to ever need to construct an object of this class for |
| 117 |
yourself, but if you want to, call |
| 118 |
\&\f(CW\*(C`Pod::Simple::PullParserTextToken\->new( \fR\f(CItext\fR\f(CW )\*(C'\fR |
| 119 |
.SH "SEE ALSO" |
| 120 |
.IX Header "SEE ALSO" |
| 121 |
Pod::Simple::PullParserToken, Pod::Simple, Pod::Simple::Subclassing |
| 122 |
.SH SUPPORT |
| 123 |
.IX Header "SUPPORT" |
| 124 |
Questions or discussion about POD and Pod::Simple should be sent to the |
| 125 |
pod\[email protected] mail list. Send an empty email to |
| 126 |
pod\-people\[email protected] to subscribe. |
| 127 |
.PP |
| 128 |
This module is managed in an open GitHub repository, |
| 129 |
<https://github.com/perl\-pod/pod\-simple/>. Feel free to fork and contribute, or |
| 130 |
to clone <https://github.com/perl\-pod/pod\-simple.git> and send patches! |
| 131 |
.PP |
| 132 |
Patches against Pod::Simple are welcome. Please send bug reports to |
| 133 |
<bug\-pod\[email protected]>. |
| 134 |
.SH "COPYRIGHT AND DISCLAIMERS" |
| 135 |
.IX Header "COPYRIGHT AND DISCLAIMERS" |
| 136 |
Copyright (c) 2002 Sean M. Burke. |
| 137 |
.PP |
| 138 |
This library is free software; you can redistribute it and/or modify it |
| 139 |
under the same terms as Perl itself. |
| 140 |
.PP |
| 141 |
This program is distributed in the hope that it will be useful, but |
| 142 |
without any warranty; without even the implied warranty of |
| 143 |
merchantability or fitness for a particular purpose. |
| 144 |
.SH AUTHOR |
| 145 |
.IX Header "AUTHOR" |
| 146 |
Pod::Simple was created by Sean M. Burke <[email protected]>. |
| 147 |
But don't bother him, he's retired. |
| 148 |
.PP |
| 149 |
Pod::Simple is maintained by: |
| 150 |
.IP \(bu 4 |
| 151 |
Allison Randal \f(CW\*(C`[email protected]\*(C'\fR |
| 152 |
.IP \(bu 4 |
| 153 |
Hans Dieter Pearcey \f(CW\*(C`[email protected]\*(C'\fR |
| 154 |
.IP \(bu 4 |
| 155 |
David E. Wheeler \f(CW\*(C`[email protected]\*(C'\fR |