X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fsplitpod;h=d5963bf4113460c7b2b31816b26b6ee22ecb75a5;hb=3246d7a3ad86dfa806dd7e514ae5fd2dacd5c0ef;hp=8db406037067aa5e56c9f3b881eb21a8b7339968;hpb=6ec7a3cac15637f4da4fd51245a4366519e35a02;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/splitpod b/pod/splitpod index 8db4060..d5963bf 100755 --- a/pod/splitpod +++ b/pod/splitpod @@ -5,28 +5,47 @@ use Pod::Functions; local $/ = ''; +$level = 0; + $cur = ''; while (<>) { next unless /^=(?!cut)/ .. /^=cut/; - if (s/=item (\S+)/$1/) { - #$cur = "POSIX::" . $1; - $cur = $1; + ++$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 <