If you have enough memory, and you're using Apache, you may want to look into using mod_perl.

Although there may be some quirks to deal with, it'll keep one copy of each module in memory, that all of the CGIs can share, so there isn't the loading and teardown for each page call.

Of course, this won't solve the general case of the issue that you're seeing (the answer to that is to not 'use' modules up front, but 'require' them as you need them, and then import the functions that you need, (if any, as you said you were using fully qualified functions).

As you've said you're using fully qualified function calls, you may have a leg up on the second approach.


In reply to Re: Dealing with large chains of dependent packages by jhourcle
in thread Dealing with large chains of dependent packages by amw1

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.