I think you really only want to load a different config file depending on the virtual host being requested. You shouldn't need to do anything fancy with your modules just 'use' then in your scripts/handlers and load the appropriate config file.

If you have some modules which are similarly named but customised for each virtual host, then you will need to look at fixing this by either merging or renaming them and relagating any differences to your config file.

Configuration Files: Writing, Dynamically Updating and Reloading <- a good read

Update:
If anybody has a solution to minimize the amount of memory taken when using the same set of modules from 2 vhosts, I'd be very glad.

Are you running cgi scripts through registry, or mod_perl handlers?

Have you gotten to this in the tuning docs..? Preloading Registry Scripts at Server Startup

cheers,

J


In reply to Re: how mod_perl finds if code has already been compiled by edoc
in thread how mod_perl finds if code has already been compiled by Sihal

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.