merlyn's advice will get you over this hump, but I still wonder whether you really need to have so many files open at the same time. As I recall from your earlier post, you were looping over hashes, such that at each iteration, one of the hash values would tell you which file to write to on that iteration -- here's a summary of the relevant parts of your code:
# open three file handles, for NT page, UNIX page, MAIL page foreach my $class ( sort keys %classHash ) { foreach my $status ( sort keys %{$classHash{$class}} ) { if ( $classname{$class} eq "NT" ) ... # set output to NT page if ( $classname{$class} eq "UNIX" ) ... # set output to UNIX page if ( $classname{$class} eq "MAIL" ) ... # set output to MAIL page ... } }
Now from the looks of that, I think the following would accomplish the same thing, but with only one file open at a time:
foreach my $page (qw/NT UNIX MAIL/) { # open output html file for this page, print the header, # maybe you open a second file for the html to "#include", # then... foreach my $class (sort grep {$classname{$_} eq $page} keys %classHa +sh ) { foreach my $status (sort keys %{$classHash{$class}}) { # print the page content, etc. } } # print the footer and close this output file(s). }
This way, you only need to be writing one output file at a time (or, as discussed in the earlier post, two files that combine to create a single web page). There's a lot less system overhead this way, and a lot less code to write (which means less code to have to maintain/fix later). I doubt that the three "sort grep {...} keys %hash" calls are going to cause any noticeable delay.

In reply to Re: Problems writing to filehandles contained in variables by graff
in thread Problems writing to filehandles contained in variables by blink

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.