1Pod::Simple::Methody(3)User Contributed Perl DocumentatioPnod::Simple::Methody(3)
2
3
4

NAME

6       Pod::Simple::Methody -- turn Pod::Simple events into method calls
7

SYNOPSIS

9        require 5;
10        use strict;
11        package SomePodFormatter;
12        use base qw(Pod::Simple::Methody);
13
14        sub handle_text {
15          my($self, $text) = @_;
16          ...
17        }
18
19        sub start_head1 {
20          my($self, $attrs) = @_;
21          ...
22        }
23        sub end_head1 {
24          my($self) = @_;
25          ...
26        }
27
28       ...and start_/end_ methods for whatever other events you want to catch.
29

DESCRIPTION

31       This class is of interest to people writing Pod formatters based on
32       Pod::Simple.
33
34       This class (which is very small -- read the source) overrides Pod::Sim‐
35       ple's _handle_element_start, _handle_text, and _handle_element_end
36       methods so that parser events are turned into method calls. (Otherwise,
37       this is a subclass of Pod::Simple and inherits all its methods.)
38
39       You can use this class as the base class for a Pod formatter/processor.
40

METHOD CALLING

42       When Pod::Simple sees a "=head1 Hi there", for example, it basically
43       does this:
44
45         $parser->_handle_element_start( "head1", \%attributes );
46         $parser->_handle_text( "Hi there" );
47         $parser->_handle_element_end( "head1" );
48
49       But if you subclass Pod::Simple::Methody, it will instead do this when
50       it sees a "=head1 Hi there":
51
52         $parser->start_head1( \%attributes ) if $parser->can('start_head1');
53         $parser->handle_text( "Hi there" )   if $parser->can('handle_text');
54         $parser->end_head1()                 if $parser->can('end_head1');
55
56       If Pod::Simple sends an event where the element name has a dash,
57       period, or colon, the corresponding method name will have a underscore
58       in its place.  For example, "foo.bar:baz" becomes start_foo_bar_baz and
59       end_foo_bar_baz.
60
61       See the source for Pod::Simple::Text for an example of using this
62       class.
63

SEE ALSO

65       Pod::Simple, Pod::Simple::Subclassing
66
68       Copyright (c) 2002 Sean M. Burke.  All rights reserved.
69
70       This library is free software; you can redistribute it and/or modify it
71       under the same terms as Perl itself.
72
73       This program is distributed in the hope that it will be useful, but
74       without any warranty; without even the implied warranty of mer‐
75       chantability or fitness for a particular purpose.
76

AUTHOR

78       Sean M. Burke "sburke@cpan.org"
79
80
81
82perl v5.8.8                       2003-11-02           Pod::Simple::Methody(3)
Impressum