Debian Codegraph @

examples/ppodindex

raw
1 #!/usr/bin/perl
2
3 ######################################################################
4 #
5 # A sample PseudoPod to TXT converter script that uses
6 # Pod::PseudoPod::Index.
7 #
8 # usage:
9 #
10 # ./textindex filename1.pod filename2.pod
11 #
12 # Will produce one html file for each pod file passed in.
13 #
14 # filename1.html
15 # filename2.html
16 #
17 ######################################################################
18
19 use strict;
20 use lib "../lib"; # delete this line
21 use Pod::PseudoPod::Index;
22
23 my $parser;
24
25 my $outfile = 'index.txt'; # in the current working directory
26
27 open TXTOUT, ">$outfile" or die "Can't write to $outfile: $!";
28
29 my $index = {};
30
31 foreach my $file (@ARGV) {
32 $parser = Pod::PseudoPod::Index->new($index);
33 $parser->no_errata_section(1); # don't put errors in doc output
34 $parser->complain_stderr(1); # output errors on STDERR instead
35
36 if (-e $file) {
37 $parser->parse_file($file);
38 } else {
39 die "Unable to open file\n";
40 }
41 }
42
43 $parser->output_fh(*TXTOUT);
44 $parser->output_text;
45
46 close TXTOUT;
47
48 exit;