X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fsplitpod;h=10fd6afb1112e922eabd4ab19315658752a0e5b2;hb=594c10dca58a5fa69624af729798b94360003867;hp=fd38e51acf88aa23256de80b626c8249316f920d;hpb=40d50c580e6c25e8b1b8fe1baed51a3d15af70f9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/splitpod b/pod/splitpod index fd38e51..10fd6af 100755 --- a/pod/splitpod +++ b/pod/splitpod @@ -1,23 +1,30 @@ #!/usr/bin/perl -use lib '../lib'; # If you haven't installed perl yet. +BEGIN { push @INC, '../lib' } # If you haven't installed perl yet. use Pod::Functions; local $/ = ''; +$level = 0; + $cur = ''; while (<>) { next unless /^=(?!cut)/ .. /^=cut/; - if (s/=item (\S+)/$1/) { - #$cur = "POSIX::" . $1; - $next{$cur} = $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 <