1 # Open in their package.
7 # But only this sub name is visible to them.
13 if (!$isopen{$file}) {
14 if (++$numopen > $maxopen) {
15 local(@lru) = sort {$isopen{$a} <=> $isopen{$b};} keys(%isopen);
16 splice(@lru, $maxopen / 3);
18 for (@lru) { close $_; delete $isopen{$_}; }
20 &open($file, ($saw{$file}++ ? '>>' : '>') . $file)
21 || die "Can't create $file: $!\n";
23 $isopen{$file} = ++$seq;
31 if (open(PARAM,'/usr/include/sys/param.h')) {
34 $maxopen = $1 - 4 if /^\s*#\s*define\s+NOFILE\s+(\d+)/;
38 $maxopen = 16 unless $maxopen;