Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Perl limits on number of open files?

by dave_the_m (Parson)
on May 14, 2004 at 23:20 UTC ( #353521=note: print w/ replies, xml ) Need Help??


in reply to Perl limits on number of open files?

The only limit on the number of open files is whatever underlying limits your OS imposes. I'm not familar with OSX, but with some OSes it's just a case of messing with ulimit; others require setting a kernel paramter in say /etc/system; others require recompiling the kernel.

For an array of filehandles, the following demonstrates this; it prints the first line from each of 3 common system files:

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;
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.


Comment on Re: Perl limits on number of open files?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://353521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2014-12-25 19:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (162 votes), past polls