make perldoc -f grok nested =items
authorGurusamy Sarathy <gsar@cpan.org>
Sat, 8 May 1999 21:48:22 +0000 (21:48 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sat, 8 May 1999 21:48:22 +0000 (21:48 +0000)
p4raw-id: //depot/perl@3336

utils/perldoc.PL

index c351fbf..e591479 100644 (file)
@@ -429,13 +429,20 @@ if ($opt_f) {
 
    # Look for our function
    my $found = 0;
+   my $inlist = 0;
    while (<PFUNC>) {
        if (/^=item\s+\Q$search_string\E\b/o)  {
           $found = 1;
        } elsif (/^=item/) {
-          last if $found > 1;
+          last if $found > 1 and not $inlist;
        }
        next unless $found;
+       if (/^=over/) {
+          ++$inlist;
+       }
+       elsif (/^=back/) {
+          --$inlist;
+       }
        push @pod, $_;
        ++$found if /^\w/;      # found descriptive text
    }