Unless you are only rarely using these particular modules, you aren't going to see any gain from this. Maybe you can fork a child, have it import and do the large module import and then pipe it back to the perl process.

Or (insert random deity here)-forbid you just use a CGI for the module-intensive, only-run-occasionally code. What you want to do with memory just can't be done. I've seen this same struggle over the past three years with mod_perl (admittedly you've gone a lot further than most... =) but in the end, neither perl nor the most common OSes make it easy to return memory.

Ideally, use mod_perl on code that needs the extra speed of already being available in the server, code that needs access to the request at early stages, and code that needs special persistence. If the code isn't basically continually being run, you are likely to be wasting your time mod_perl'ing it.

--
$you = new YOU;
honk() if $you->love(perl)


In reply to RE: finding all modules used from a script by extremely
in thread finding all modules used from a script by d_i_r_t_y

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.