You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ryan Underwood <ne...@icequake.net> on 2004/10/03 05:06:22 UTC
Using different versions of perl libraries with same name
Hi,
I'm looking for a solution to the following problem.
I have an engine library MySite which is a common base of code used to
build a new site upon.
Site1, Site2, and Site3 each have a copy of MySite at various stages in
development; the copies of MySite aren't always in a consistent state
because as I fix something or add a feature to the engine for a
particular site, I have to regression test it before running the other
sites against it.
I'm trying to figure out how to have three varying copies of MySite
under the same mod_perl server. As far as I can tell, perl just uses
the first one it encounters.
I could rework things like putting MySite under Site1 (yielding
Site1::MySite::Foo) or renaming MySite for each site (yielding
MySite_Site1::Foo), but both of these methods aren't going to let me use
CVS on the live copies.
I could run a separate mod_perl server for each site using MySite, but
this eats up more memory and requires extra initscript handholding.
I had a fleeting thought about some kind of kludge in the startup script
for each site that would do something like the following: read each
library file and application file into a string,
s/MySite/MySite_Site1/g, and eval the resulting string. But I'm not
enough of a Perl guru to know whether that will work or not.
So I'm here soliciting advice. I hope that was somewhat clear and that
I'm not crazy....
thanks,
--
Ryan Underwood, <ne...@icequake.net>
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Using different versions of perl libraries with same name
Posted by Ryan Underwood <ne...@icequake.net>.
On Sun, Oct 03, 2004 at 12:00:31AM -0400, Stas Bekman wrote:
> >
> >Apache::PerlVINC?
> >
> > http://search.cpan.org/~davem/Apache-PerlVINC-0.03/
Cool, that's not a perfect solution but it should work. I hope it gets
along with Apache::Reload.
> and if using modperl2, see:
> http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_
>
> Ryan, please always mention what modperl version you are using, so we
> don't have to guess. Thank you.
Sorry about that, this is mod_perl version 1.
--
Ryan Underwood, <ne...@icequake.net>
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Using different versions of perl libraries with same name
Posted by Ryan Underwood <ne...@icequake.net>.
On Sun, Oct 03, 2004 at 12:00:31AM -0400, Stas Bekman wrote:
> >
> >
> >Apache::PerlVINC?
> >
> > http://search.cpan.org/~davem/Apache-PerlVINC-0.03/
hmm, I tried this. It seems to function as designed, but an undesirable
side-effect is a noticeable delay on _every_ page load, even when
reloading the same virtual host (so it shouldn't have to
reload/recompile the module). I started out specifying every module in
the library, but cut it down to 1 module; the delay is still there.
Comment out the 1 remaining PerlVersion line (but allow the
Apache::PerlVINC module to load still) and reloads are blazing fast.
Any idea what goes on here?
--
Ryan Underwood, <ne...@icequake.net>
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Using different versions of perl libraries with same name
Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>
> Ryan Underwood wrote:
>
>>Hi,
>>
>>I'm looking for a solution to the following problem.
>>
>>I have an engine library MySite which is a common base of code used to
>>build a new site upon.
>>
>>Site1, Site2, and Site3 each have a copy of MySite at various stages in
>>development; the copies of MySite aren't always in a consistent state
>>because as I fix something or add a feature to the engine for a
>>particular site, I have to regression test it before running the other
>>sites against it.
>>
>>I'm trying to figure out how to have three varying copies of MySite
>>under the same mod_perl server. As far as I can tell, perl just uses
>>the first one it encounters.
>
>
> Apache::PerlVINC?
>
> http://search.cpan.org/~davem/Apache-PerlVINC-0.03/
and if using modperl2, see:
http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_
Ryan, please always mention what modperl version you are using, so we
don't have to guess. Thank you.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Using different versions of perl libraries with same name
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Ryan Underwood wrote:
> Hi,
>
> I'm looking for a solution to the following problem.
>
> I have an engine library MySite which is a common base of code used to
> build a new site upon.
>
> Site1, Site2, and Site3 each have a copy of MySite at various stages in
> development; the copies of MySite aren't always in a consistent state
> because as I fix something or add a feature to the engine for a
> particular site, I have to regression test it before running the other
> sites against it.
>
> I'm trying to figure out how to have three varying copies of MySite
> under the same mod_perl server. As far as I can tell, perl just uses
> the first one it encounters.
Apache::PerlVINC?
http://search.cpan.org/~davem/Apache-PerlVINC-0.03/
HTH
--Geoff
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html