This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change 27330 failed to decontaminate SvCUR/GvFLAGS when upgrading an
[perl5.git] / pod / splitpod
index ff60ddc..d5963bf 100755 (executable)
@@ -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;