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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.