This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Pod-Simple to CPAN version 3.28
[perl5.git] / cpan / Pod-Simple / lib / Pod / Simple / PullParserEndToken.pm
CommitLineData
351625bd
SP
1
2require 5;
3package Pod::Simple::PullParserEndToken;
4use Pod::Simple::PullParserToken ();
351625bd 5use strict;
a242eeb4
JV
6use vars qw(@ISA $VERSION);
7@ISA = ('Pod::Simple::PullParserToken');
b5ae6e74 8$VERSION = '3.28';
351625bd
SP
9
10sub new { # Class->new(tagname);
11 my $class = shift;
12 return bless ['end', @_], ref($class) || $class;
13}
14
15# Purely accessors:
16
17sub tagname { (@_ == 2) ? ($_[0][1] = $_[1]) : $_[0][1] }
18sub tag { shift->tagname(@_) }
19
20# shortcut:
21sub is_tagname { $_[0][1] eq $_[1] }
22sub is_tag { shift->is_tagname(@_) }
23
241;
25
26
27__END__
28
29=head1 NAME
30
31Pod::Simple::PullParserEndToken -- end-tokens from Pod::Simple::PullParser
32
33=head1 SYNOPSIS
34
35(See L<Pod::Simple::PullParser>)
36
37=head1 DESCRIPTION
38
39When you do $parser->get_token on a L<Pod::Simple::PullParser>, you might
40get an object of this class.
41
42This is a subclass of L<Pod::Simple::PullParserToken> and inherits all its methods,
43and adds these methods:
44
45=over
46
47=item $token->tagname
48
49This returns the tagname for this end-token object.
50For example, parsing a "=head1 ..." line will give you
51a start-token with the tagname of "head1", token(s) for its
52content, and then an end-token with the tagname of "head1".
53
54=item $token->tagname(I<somestring>)
55
56This changes the tagname for this end-token object.
57You probably won't need to do this.
58
59=item $token->tag(...)
60
61A shortcut for $token->tagname(...)
62
63=item $token->is_tag(I<somestring>) or $token->is_tagname(I<somestring>)
64
65These are shortcuts for C<< $token->tag() eq I<somestring> >>
66
67=back
68
69You're unlikely to ever need to construct an object of this class for
70yourself, but if you want to, call
71C<<
72Pod::Simple::PullParserEndToken->new( I<tagname> )
73>>
74
75=head1 SEE ALSO
76
77L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing>
78
a242eeb4
JV
79=head1 SUPPORT
80
81Questions or discussion about POD and Pod::Simple should be sent to the
82pod-people@perl.org mail list. Send an empty email to
83pod-people-subscribe@perl.org to subscribe.
84
85This module is managed in an open GitHub repository,
9dd0d393 86L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
a242eeb4
JV
87to clone L<git://github.com/theory/pod-simple.git> and send patches!
88
89Patches against Pod::Simple are welcome. Please send bug reports to
90<bug-pod-simple@rt.cpan.org>.
91
351625bd
SP
92=head1 COPYRIGHT AND DISCLAIMERS
93
433cf6b4 94Copyright (c) 2002 Sean M. Burke.
351625bd
SP
95
96This library is free software; you can redistribute it and/or modify it
97under the same terms as Perl itself.
98
99This program is distributed in the hope that it will be useful, but
100without any warranty; without even the implied warranty of
101merchantability or fitness for a particular purpose.
102
103=head1 AUTHOR
104
a242eeb4
JV
105Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
106But don't bother him, he's retired.
351625bd 107
a242eeb4 108Pod::Simple is maintained by:
351625bd 109
a242eeb4
JV
110=over
111
112=item * Allison Randal C<allison@perl.org>
113
114=item * Hans Dieter Pearcey C<hdp@cpan.org>
115
116=item * David E. Wheeler C<dwheeler@cpan.org>
117
118=back
119
120=cut