NAME

Reference documentation for the $::opt_t module

EOF

require XML::Parser; if ($@ || ! -f $file) { print "Not available because XML::Parser and/or XML::Writer were missing at module build time\n"; close(OUT); exit(0); } my $parser = new XML::Parser(Style=>'Stream', Pkg=>'main'); $parser->parsefile($file);

close(OUT);

sub StartTag { my ($p, $t) = @_; $lasttag = $t; for ($t) { /^package$/ && do { print "\n=head1 $_{name}\n\n"; next; }; /^desc$/ && do { print "=back\n\n" unless $doneback; $doneback = 1; }; /^method$/ && do { $inmethods = {%_}; }; /^arg$/ && do { if (defined $inmethods) { print "\n=head2 $inmethods->{out} $_{name}","->","$inmethods->{name} ($inmethods->{args})\n\n"; print "=over 4\n\n"; $doneback = 0; undef $inmethods; } else { print "=item * $_{name} ($_{type}) $_{desc}\n\n"; } }; } }

sub EndTag { my ($p, $t) = @_; for ($t) { /^package$/ && do { }; /^method$/ && do { print "=back\n\n" unless $doneback; undef $inmethods; }; } }

sub Text { if ($lasttag eq 'desc') { print; print "\n\n"; } }