summaryrefslogtreecommitdiff
path: root/utils/perldoc.PL
diff options
context:
space:
mode:
authorJoseph N. Hall <joseph@5sigma.com>1997-09-05 00:00:00 +0000
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-09-05 00:00:00 +0000
commit62b753c6ae4ab9bf22fbb6ec7ceac820bcef8fe4 (patch)
treeb4cbf4eb311aa6b2ca921034e735fe52d2078316 /utils/perldoc.PL
parent41f926b844140b7f7eaa9302113e45df3a9f9ff4 (diff)
downloadperl-62b753c6ae4ab9bf22fbb6ec7ceac820bcef8fe4.tar.gz
perldoc diffs: don't search auto - much faster
Give this a try. It causes unsuccessful searches to run about 3 times as fast on my machine. Not exactly a speed demon but at least you don't have time to get up and make coffee. I tried adding caching to stop the repeated readdir in the case-insensitive matching subroutine, but a) it only lopped off another 20% and b) the patch made a kind of a Frankenstein thing out of the subroutine, so c) I will try to write a better one later when I have time. p5p-msgid: MailDrop1.2d7dPPC.971012211957@screechy.cscaper.com
Diffstat (limited to 'utils/perldoc.PL')
-rw-r--r--utils/perldoc.PL6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/perldoc.PL b/utils/perldoc.PL
index 0f43c36c1b..0bb45424f8 100644
--- a/utils/perldoc.PL
+++ b/utils/perldoc.PL
@@ -195,7 +195,11 @@ sub minus_f_nocase {
if($recurse) {
opendir(D,$dir);
- my(@newdirs) = grep(-d,map("$dir/$_",grep(!/^\.\.?$/,readdir(D))));
+ my @newdirs = map "$dir/$_", grep {
+ not /^\.\.?$/ and
+ not /^auto$/ and # save time! don't search auto dirs
+ -d "$dir/$_"
+ } readdir D;
closedir(D);
@newdirs = map((s/.dir$//,$_)[1],@newdirs) if $Is_VMS;
next unless @newdirs;