#!/usr/bin/perl BEGIN { push @INC, '../lib' } # If you haven't installed perl yet. use Pod::Functions; local $/ = ''; $level = 0; $cur = ''; while (<>) { next unless /^=(?!cut)/ .. /^=cut/; ++$level if /^=over/; --$level if /^=back/; # Ignore items that are nested within other items, e.g. don't split on the # items nested within the pack() and sprintf() items in perlfunc.pod. if (/=item (\S+)/ and $level == 1) { my $item = $1; s/=item //; $next{$cur} = $item; $cur = $item; $syn{$cur} .= $_; next; } else { s,L $name.pod") || die "can't open $name.pod: $!"; print POD <