From: Mark-Jason Dominus Date: Sun, 4 Oct 1998 14:48:11 +0000 (-0400) Subject: PATCH: perldoc -f does not locate -e, -r, -x, etc. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c437c45787750ba4b841b3d6c173dab1a4cd3419;p=p5sagit%2Fp5-mst-13.2.git PATCH: perldoc -f does not locate -e, -r, -x, etc. Message-ID: <19981004184811.16048.qmail@plover.com> p4raw-id: //depot/perl@1926 --- diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 875cd25..b680b90 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -408,6 +408,9 @@ if ($opt_f) { my $perlfunc = shift @found; open(PFUNC, $perlfunc) or die "Can't open $perlfunc: $!"; + # Functions like -r, -e, etc. are listed under `-X'. + my $search_string = ($opt_f =~ /^-[rwxoRWXOeszfdlpSbctugkTBMAC]$/) ? 'I<-X' : $opt_f ; + # Skip introduction while () { last if /^=head2 Alphabetical Listing of Perl Functions/; @@ -417,7 +420,7 @@ if ($opt_f) { my $found = 0; my @pod; while () { - if (/^=item\s+\Q$opt_f\E\b/o) { + if (/^=item\s+\Q$search_string\E\b/o) { $found = 1; } elsif (/^=item/) { last if $found > 1;