#! /usr/bin/env perl # pod2html creates complete pages, but we want embeddable ones. # Fortunately, it's easy to find the stuff that need to go away. use strict; use warnings; local $/; # Slurp the whole file my $contents = ; $contents =~ m@^

NAME

@m; $contents = $&.$'; # Everything before NAME is stripped $contents =~ m@^@m; $contents = $`; # and everything after is stripped # Adapt all H tags to be wrapped inside H1 and H2 $contents =~ s@()@$1.($2 + 2).$3@emg; print $contents;