package podtools;
use strict;
use Pod::Html;
use Pod::Text;
sub pod2_htm_txt {
# Creates htm and txt files from a given pod file and htm title
my (
$pod_filename,
$htm_filename,
$title,
$txt_filename,
) = @_;
# Build the '.htm' file
pod2html(
"--infile=$pod_filename",
"--outfile=$htm_filename",
"--title=$title",
'--backlink=Back to Top', # implants backlink after =head1
);
# Build the '.txt' file
my $parser = Pod::Text->new (
loose => 1, # prints blank lines after =head1
width => 78,
quotes => 'none',
);
# Read POD from first file and write to second.
$parser->parse_from_file ( $pod_filename, $txt_filename );
}
1;