I have exactly this problem, slightly bigger - currently 46 vhosts running between them 6 different versions of an application - and I've avoided mod_perl for now precisely because of the problem of multiple library versions. I understand that v2 mod_perl does/will fix this problem.

Under v1 it might be possible to work around this problem if each module user knows (or can reach an object that knows) what version of each module it needs. It'd be a bit of a pain, but I can imagine replace each use My::Module; with $application->load_module('My::Module'), and (roughly):

sub Application::load_module { my($self, $class) = @_; return 1 if do { no strict 'refs'; # may need string eq here ${"${class}::VERSION"} == $self->required_version($class); }; (my $path = "$class.pm") =~ s{::}{/}g; delete $INC{$path}; require $path; }

It may also be possible to roll up something similar at a lower conceptual cost using Ingy's only.

Hugo


In reply to Re: different versions of same Perl module in different Apache vhosts by hv
in thread different versions of same Perl module in different Apache vhosts by agaffney

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.