X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/279b5f1a612874b608bbd09f6635e256c67090a7..3b6733bfa57f98be8915f7c25b14180d042dd456:/pod/splitpod diff --git a/pod/splitpod b/pod/splitpod index ff60ddc..d5963bf 100755 --- a/pod/splitpod +++ b/pod/splitpod @@ -5,12 +5,19 @@ use Pod::Functions; local $/ = ''; +$level = 0; + $cur = ''; while (<>) { next unless /^=(?!cut)/ .. /^=cut/; - if (/=item (\S+)/ and $1 ne '*') { + ++$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;