Pod/Text.pm

filter: Statementstmt 83.3% 10 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 87.5% 14 / 16 CC 1 SCAR 0.7
CC
1
Cov
83%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Pod/HTML.pm ↑ Summary
1 package Apache::Pod::Text;
2  
3 =head1 NAME
4  
5 Apache::Pod::Text - mod_perl handler to convert Pod to plain text
6  
7 =head1 VERSION
8  
9 Version 0.22
10  
11 =cut
12  
13 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 $VERSION = '0.22';
17  
18 =head1 SYNOPSIS
19  
20 A simple mod_perl handler to easily convert Pod to Text.
21  
22 =head1 CONFIGURATION
23  
24 See L<Apache::Pod::HTML> for configuration details.
25  
26 =cut
27  
28 2 ▶use Apache::Pod;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 0 ▶use Apache::Constants;
Subroutine BEGIN: called CC=1 SCAR=2.6
30 use Pod::Simple::Text;
31  
32 sub handler {
33 my $r = shift;
34  
35 my $str;
36 my $file = Apache::Pod::getpod( $r );
37  
38 my $parser = Pod::Simple::Text->new;
39 $parser->complain_stderr(1);
40 $parser->output_string( \$str );
41 $parser->parse_file( $file );
42  
43 $r->content_type('text/plain');
44 $r->send_http_header;
45 $r->print( $str );
46  
47 return OK;
48 }
49  
50 =head1 AUTHOR
51  
52 Andy Lester C<< <andy@petdance.com> >>, adapted from Apache::Perldoc by
53 Rich Bowen C<< <rbowen@ApacheAdmin.com> >>
54  
55 =head1 LICENSE
56  
57 This package is licensed under the same terms as Perl itself.
58  
59 =cut
60  
61 1;
« Pod/HTML.pm ↑ Summary