in reply to Perl limits on number of open files?
For an array of filehandles, the following demonstrates this; it prints the first line from each of 3 common system files:
I believe there is a Perl module that maintains a cache of open filehandles, but I can't for the life of me remember what it's called. No doubt someone else will.my @fhs; for my $file (qw(/etc/hosts /etc/rpc /etc/services)) { my $fh; open $fh, $file or die "open $file: $!\n"; push @fhs, $fh; } print scalar <$_> for @fhs;
|
|---|