1Pod::Simple::PullParserUTsoekrenC(o3n)tributed Perl DocuPmoedn:t:aStiimopnle::PullParserToken(3)
2
3
4

NAME

6       Pod::Simple::PullParserToken -- tokens from Pod::Simple::PullParser
7

SYNOPSIS

9       Given a $parser that's an object of class Pod::Simple::PullParser (or a
10       subclass)...
11
12         while(my $token = $parser->get_token) {
13           $DEBUG and print STDERR "Token: ", $token->dump, "\n";
14           if($token->is_start) {
15             ...access $token->tagname, $token->attr, etc...
16
17           } elsif($token->is_text) {
18             ...access $token->text, $token->text_r, etc...
19
20           } elsif($token->is_end) {
21             ...access $token->tagname...
22
23           }
24         }
25
26       (Also see Pod::Simple::PullParser)
27

DESCRIPTION

29       When you do $parser->get_token on a Pod::Simple::PullParser, you should
30       get an object of a subclass of Pod::Simple::PullParserToken.
31
32       Subclasses will add methods, and will also inherit these methods:
33
34       $token->type
35           This returns the type of the token.  This will be either the string
36           "start", the string "text", or the string "end".
37
38           Once you know what the type of an object is, you then know what
39           subclass it belongs to, and therefore what methods it supports.
40
41           Yes, you could probably do the same thing with code like
42           $token->isa('Pod::Simple::PullParserEndToken'), but that's not so
43           pretty as using just $token->type, or even the following shortcuts:
44
45       $token->is_start
46           This is a shortcut for "$token->type() eq "start""
47
48       $token->is_text
49           This is a shortcut for "$token->type() eq "text""
50
51       $token->is_end
52           This is a shortcut for "$token->type() eq "end""
53
54       $token->dump
55           This returns a handy stringified value of this object.  This is
56           useful for debugging, as in:
57
58             while(my $token = $parser->get_token) {
59               $DEBUG and print STDERR "Token: ", $token->dump, "\n";
60               ...
61             }
62

SEE ALSO

64       My subclasses: Pod::Simple::PullParserStartToken,
65       Pod::Simple::PullParserTextToken, and Pod::Simple::PullParserEndToken.
66
67       Pod::Simple::PullParser and Pod::Simple
68

SUPPORT

70       Questions or discussion about POD and Pod::Simple should be sent to the
71       pod-people@perl.org mail list. Send an empty email to
72       pod-people-subscribe@perl.org to subscribe.
73
74       This module is managed in an open GitHub repository,
75       <https://github.com/perl-pod/pod-simple/>. Feel free to fork and
76       contribute, or to clone <git://github.com/perl-pod/pod-simple.git> and
77       send patches!
78
79       Patches against Pod::Simple are welcome. Please send bug reports to
80       <bug-pod-simple@rt.cpan.org>.
81
83       Copyright (c) 2002 Sean M. Burke.
84
85       This library is free software; you can redistribute it and/or modify it
86       under the same terms as Perl itself.
87
88       This program is distributed in the hope that it will be useful, but
89       without any warranty; without even the implied warranty of
90       merchantability or fitness for a particular purpose.
91

AUTHOR

93       Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.  But don't
94       bother him, he's retired.
95
96       Pod::Simple is maintained by:
97
98       •   Allison Randal "allison@perl.org"
99
100       •   Hans Dieter Pearcey "hdp@cpan.org"
101
102       •   David E. Wheeler "dwheeler@cpan.org"
103
104
105
106perl v5.36.0                      2022-07-22   Pod::Simple::PullParserToken(3)
Impressum