diff options
author | Larry Wall <lwall@netlabs.com> | 1991-11-05 09:55:53 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-11-05 09:55:53 +0000 |
commit | 55204971972392ce5a252fbbd6d78b1c48ed70e3 (patch) | |
tree | a0fc0fa7a40dae3b455667572b9aac94b020c246 /lib/cacheout.pl | |
parent | de3bb51191e884300caf98892ecfcc0ca3ebc09c (diff) | |
download | perl-55204971972392ce5a252fbbd6d78b1c48ed70e3.tar.gz |
perl 4.0 patch 18: patch #11, continued
See patch #11.
Diffstat (limited to 'lib/cacheout.pl')
-rw-r--r-- | lib/cacheout.pl | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/cacheout.pl b/lib/cacheout.pl index 106014cc5d..bec40bde62 100644 --- a/lib/cacheout.pl +++ b/lib/cacheout.pl @@ -12,11 +12,9 @@ sub cacheout { package cacheout; ($file) = @_; - ($package) = caller; if (!$isopen{$file}) { if (++$numopen > $maxopen) { - sub byseq {$isopen{$a} != $isopen{$b};} - local(@lru) = sort byseq keys(%isopen); + local(@lru) = sort {$isopen{$a} <=> $isopen{$b};} keys(%isopen); splice(@lru, $maxopen / 3); $numopen -= @lru; for (@lru) { close $_; delete $isopen{$_}; } @@ -35,7 +33,7 @@ $numopen = 0; if (open(PARAM,'/usr/include/sys/param.h')) { local($.); while (<PARAM>) { - $maxopen = $1 - 4 if /^#define NOFILE\s+(\d+)/; + $maxopen = $1 - 4 if /^\s*#\s*define\s+NOFILE\s+(\d+)/; } close PARAM; } |