From c437c45787750ba4b841b3d6c173dab1a4cd3419 Mon Sep 17 00:00:00 2001 From: Mark-Jason Dominus Date: Sun, 4 Oct 1998 10:48:11 -0400 Subject: [PATCH] PATCH: perldoc -f does not locate -e, -r, -x, etc. Message-ID: <19981004184811.16048.qmail@plover.com> p4raw-id: //depot/perl@1926 --- utils/perldoc.PL | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.7.4