Hi all,

DHZ> use lib /path1/lib.pm
DHZ> ..

DHZ> and in the startup file of vhost 2

DHZ> ..
DHZ> use lib /path2/lib.pm
DHZ> ..

DHZ> This works for me.
DHZ> Both lib.pm's are separated because new perl interpreters are used
for DHZ> vhost1 and vhost2.

Thanks Helmut, I will try this solution (PerlOptions +Parent) later,
after learning this option of mod_perl...


I didn't realize that +Parent worked yet for the newer threaded apache/mod_perl.


It really works! (Apache 2.48, mp 1.99_10 - ok not the newest, Perl 5.9.0 with ithreads)


Here is my test configuration:

vhost1.conf:
..
   PerlOptions +Parent
   PerlRequire /www/hz1/conf/startup.pl
   PerlModule  Apache::ASP
..

/www/hz1/conf/startup.pl:
..
use lib '/www/hz1/lib';
..

/www/hz1/lib/TestLib:

package TestLib;
..
sub which_lib {
   return "lib1";
}
..

/www/hz1/test.asp:
<%
use TestLib;
print which_lib();
%>

vhost2.conf:
..
   PerlOptions +Parent
   PerlRequire /www/hz2/conf/startup.pl
   PerlModule  Apache::ASP
..

/www/hz2/conf/startup.pl:
..
use lib '/www/hz2/lib';
..

/www/hz2/lib/TestLib:

package TestLib;
..
sub which_lib {
   return "lib2";
}
..

/www/hz2/test.asp:
<%
use TestLib;
print which_lib();
%>

Results:

http://vhost1/test.asp     prints out 'lib1'
and
http://vhost2/test.asp     prints out 'lib2'

when you comment out the +Parent Option both are printing out 'lib1' (bescause vhost1 comes before vhost2 in my config file),
when you change the order both are printing 'lib2'.



Regards Helmut














---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to