sub per_version {
if ($Pod::Html::VERSION eq '1.01') {
# perl5.005_03
*Pod::Html::process_text2 = \&Pod::Html::process_text1;
undef *Pod::Html::process_text1;
*Pod::Html::process_text1 = \&my_process;
@options = qw/ --recurse --header /;
} elsif ($Pod::Html::VERSION =~ /^1\.0[34]$/) {
# perl-5.6.0, 5.6.1, 5.8.0
*Pod::Html::process_L2 = \&Pod::Html::process_L;
undef *Pod::Html::process_L;
*Pod::Html::process_L = \&my_oldprocess;
@options = qw/ --recurse /;
} else {
die "Don't know how to hack Pod::Html v$Pod::Html::VERSION\n";
}
sub my_process ($$;$$) {
my($lev, $rstr, $func, $closing) = @_;
my $closer = '>' x (($closing||0) + 1);
if ($func && $func eq 'L') {
# suppress 'the ... manpage' markup
$$rstr =~ s{^
^ ( \w+ (?: ::\w+ )* )
(?: -(?!$closer)> (\w+) )?
(.*?) (\s* $closer)
}{
defined($2) ? qq{$1-E$2$3|$1/"item_$2$4} : "$1$3|$1$4"
}xe;
}
Pod::Html::process_text2($lev, $rstr, $func, $closing);
}
sub my_oldprocess {
my($str) = @_;
$str =~ s,^(\w+(::\w+)*)$,$1|$1/,;
Pod::Html::process_L2($str);
}