From 55204971972392ce5a252fbbd6d78b1c48ed70e3 Mon Sep 17 00:00:00 2001 From: Larry Wall Date: Tue, 5 Nov 1991 09:55:53 +0000 Subject: perl 4.0 patch 18: patch #11, continued See patch #11. --- lib/cacheout.pl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/cacheout.pl') 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 () { - $maxopen = $1 - 4 if /^#define NOFILE\s+(\d+)/; + $maxopen = $1 - 4 if /^\s*#\s*define\s+NOFILE\s+(\d+)/; } close PARAM; } -- cgit v1.2.1