1 warn "Legacy library @{[(caller(0))[6]]} will be removed from the Perl core distribution in the next major release. Please install it from the CPAN distribution Perl4::CoreLibs. It is being used at @{[(caller)[1]]}, line @{[(caller)[2]]}.\n";
4 # This library is no longer being maintained, and is included for backward
5 # compatibility with Perl 4 programs which may require it.
6 # This legacy library is deprecated and will be removed in a future
9 # In particular, this should not be used as an example of modern Perl
10 # programming techniques.
12 # Suggested alternative: FileCache
14 # Open in their package.
26 # But only this sub name is visible to them.
32 if (!$isopen{$file}) {
33 if (++$numopen > $maxopen) {
34 local(@lru) = sort {$isopen{$a} <=> $isopen{$b};} keys(%isopen);
35 splice(@lru, $maxopen / 3);
37 for (@lru) { &close($_); delete $isopen{$_}; }
39 &open($file, ($saw{$file}++ ? '>>' : '>') . $file)
40 || die "Can't create $file: $!\n";
42 $isopen{$file} = ++$seq;
50 if (open(PARAM,'/usr/include/sys/param.h')) {
53 $maxopen = $1 - 4 if /^\s*#\s*define\s+NOFILE\s+(\d+)/;
57 $maxopen = 16 unless $maxopen;