3 package Pod::Simple::PullParserTextToken;
4 use Pod::Simple::PullParserToken ();
6 use vars qw(@ISA $VERSION);
7 @ISA = ('Pod::Simple::PullParserToken');
10 sub new { # Class->new(text);
12 return bless ['text', @_], ref($class) || $class;
17 sub text { (@_ == 2) ? ($_[0][1] = $_[1]) : $_[0][1] }
19 sub text_r { \ $_[0][1] }
27 Pod::Simple::PullParserTextToken -- text-tokens from Pod::Simple::PullParser
31 (See L<Pod::Simple::PullParser>)
35 When you do $parser->get_token on a L<Pod::Simple::PullParser>, you might
36 get an object of this class.
38 This is a subclass of L<Pod::Simple::PullParserToken> and inherits all its methods,
39 and adds these methods:
45 This returns the text that this token holds. For example, parsing
46 CZ<><foo> will return a C start-token, a text-token, and a C end-token. And
47 if you want to get the "foo" out of the text-token, call C<< $token->text >>
49 =item $token->text(I<somestring>)
51 This changes the string that this token holds. You probably won't need
54 =item $token->text_r()
56 This returns a scalar reference to the string that this token holds.
57 This can be useful if you don't want to memory-copy the potentially
58 large text value (well, as large as a paragraph or a verbatim block)
59 as calling $token->text would do.
61 Or, if you want to alter the value, you can even do things like this:
63 for ( ${ $token->text_r } ) { # Aliases it with $_ !!
65 s/ The / the /g; # just for example
67 if( 'A' eq chr(65) ) { # (if in an ASCII world)
72 ...or however you want to alter the value...
77 You're unlikely to ever need to construct an object of this class for
78 yourself, but if you want to, call
80 Pod::Simple::PullParserTextToken->new( I<text> )
85 L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing>
89 Questions or discussion about POD and Pod::Simple should be sent to the
90 pod-people@perl.org mail list. Send an empty email to
91 pod-people-subscribe@perl.org to subscribe.
93 This module is managed in an open GitHub repository,
94 L<http://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
95 to clone L<git://github.com/theory/pod-simple.git> and send patches!
97 Patches against Pod::Simple are welcome. Please send bug reports to
98 <bug-pod-simple@rt.cpan.org>.
100 =head1 COPYRIGHT AND DISCLAIMERS
102 Copyright (c) 2002 Sean M. Burke.
104 This library is free software; you can redistribute it and/or modify it
105 under the same terms as Perl itself.
107 This program is distributed in the hope that it will be useful, but
108 without any warranty; without even the implied warranty of
109 merchantability or fitness for a particular purpose.
113 Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
114 But don't bother him, he's retired.
116 Pod::Simple is maintained by:
120 =item * Allison Randal C<allison@perl.org>
122 =item * Hans Dieter Pearcey C<hdp@cpan.org>
124 =item * David E. Wheeler C<dwheeler@cpan.org>