summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/utils/perldoc.PL
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1999-05-02 14:33:17 +0000
committermarkm <markm@FreeBSD.org>1999-05-02 14:33:17 +0000
commit77644ee620b6a79cf8c538abaf7cd301a875528d (patch)
treeb4adabf341898a4378f4b7f8c7fb65f3f7c77769 /contrib/perl5/utils/perldoc.PL
parent4fcbc3669aa997848e15198cc9fb856287a6788c (diff)
downloadFreeBSD-src-77644ee620b6a79cf8c538abaf7cd301a875528d.zip
FreeBSD-src-77644ee620b6a79cf8c538abaf7cd301a875528d.tar.gz
Maintenance releace 3 of perl5.005. Includes support for threads.
Diffstat (limited to 'contrib/perl5/utils/perldoc.PL')
-rw-r--r--contrib/perl5/utils/perldoc.PL13
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/perl5/utils/perldoc.PL b/contrib/perl5/utils/perldoc.PL
index 875cd25..2633510 100644
--- a/contrib/perl5/utils/perldoc.PL
+++ b/contrib/perl5/utils/perldoc.PL
@@ -91,7 +91,7 @@ Options:
-F Arguments are file names, not modules
-v Verbosely describe what's going on
-X use index if present (looks for pod.idx at $Config{archlib})
-
+ -q Search the text of questions (not answers) in perlfaq[1-9]
PageName|ModuleName...
is the name of a piece of documentation that you want to look at. You
@@ -188,7 +188,7 @@ sub minus_f_nocase {
if (!$opt_i or $Is_VMS or $Is_MSWin32 or $Is_Dos or $^O eq 'os2') {
# on a case-forgiving file system or if case is important
# that is it all we can do
- warn "Ignored $file: unreadable\n" if -f _;
+ warn "Ignored $path: unreadable\n" if -f _;
return '';
}
local *DIR;
@@ -227,7 +227,7 @@ sub minus_f_nocase {
return "" unless $found;
push @p, $cip;
return "@p" if -f "@p" and -r _;
- warn "Ignored $file: unreadable\n" if -f _;
+ warn "Ignored @p: unreadable\n" if -f _;
}
}
return "";
@@ -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 (<PFUNC>) {
last if /^=head2 Alphabetical Listing of Perl Functions/;
@@ -417,7 +420,7 @@ if ($opt_f) {
my $found = 0;
my @pod;
while (<PFUNC>) {
- 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;
@@ -456,7 +459,7 @@ if ($opt_q) {
my @pod;
while (<>) {
- if (/^=head2\s+.*$opt_q/oi) {
+ if (/^=head2\s+.*(?:$opt_q)/oi) {
$found = 1;
push @pod, "=head1 Found in $ARGV\n\n" unless $found_in{$ARGV}++;
} elsif (/^=head2/) {
OpenPOWER on IntegriCloud