#!/usr/bin/perl -w use Pod::Parser; package MyParser; @ISA = qw(Pod::Parser); use strict; sub command { my ( $parser, $command, $paragraph, $line_num ) = @_; # if ( $command eq 'head1' ) { } # else { } my $expansion = $parser->interpolate( $paragraph, $line_num ); return ($expansion); } sub verbatim { my ( $parser, $paragraph, $line_num ) = @_; return ($paragraph); } sub textblock { my ( $parser, $paragraph, $line_num ) = @_; my $expansion = $parser->interpolate( $paragraph, $line_num ); return ($expansion); } sub interior_sequence { my $self = shift; $self->SUPER->interior_sequence; } package main; use strict; use vars qw(@files); use Data::Dumper; use File::Find; use File::Glob qw(:glob); use Pod::Parser; no warnings 'File::Find'; # per suggestion of the docs for File::Find $| = 1; my (@searchpath); foreach my $i ( 0 .. $#INC ) { push( @searchpath, File::Glob::bsd_glob( $INC[$i], GLOB_TILDE | GLOB_ERR ) ); } find( { wanted => \&wanted, no_chdir => 1 }, @searchpath ); sub wanted { if ( $File::Find::name =~ m/Find\.pm$/ ) { push( @files, $File::Find::name ); } } my ($content); open( DF, $files[0] ) or die("Can't open $files[0] for input: $!\n"); { local ( $/ = undef ); $content = ; } close(DF); my $parser = new MyParser(); my $text = $parser->parse_text( $content, 0 ); print $text, "\n"; #print Data::Dumper->Dump( [ \$text ], [qw(*text)] ), "\n"; # # # # Output results: # # $ perl test.4.pl # Pod::ParseTree=ARRAY(0x8216778) #