From: Gurusamy Sarathy Date: Sat, 8 May 1999 21:48:22 +0000 (+0000) Subject: make perldoc -f grok nested =items X-Git-Tag: accepted/trunk/20130322.191538~36499 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d74db03f1398d522128bfcb8a1ea0b26547d290;p=platform%2Fupstream%2Fperl.git make perldoc -f grok nested =items p4raw-id: //depot/perl@3336 --- diff --git a/utils/perldoc.PL b/utils/perldoc.PL index c351fbf..e591479 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -429,13 +429,20 @@ if ($opt_f) { # Look for our function my $found = 0; + my $inlist = 0; while () { 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 }