Hi,

If I am developing an app that has a bunch of perl modules as part of
the repository (the modules are dedicated for this project), how do I
get Apache/mod_perl to use the correct version?

Say my repository exports like this:

projectDir
|
|
----MyLib (contains "X.pm", "Y.pm" ...)
|
|
---- site ---- cgi --- app.cgi

Say I export different versions of this into directories R1.00, R1.01,
in a dir outside the build tree. Now I symlink the site directories to
/var/www/test and /var/www/prod. (This is all done with scripts
followed by a server restart.)

Til now I've been using

use lib "../..";
use MyLib::X;

in app.cgi. I thought it was working fine, but I'm not so sure now ...
especially after reading :

(snip)
Even though @INC typically includes dot ("."), the current directory,
this really isn't as useful as you'd think. For one thing, the dot
entry comes at the end, not the start, so that modules installed in the
current directory don't suddenly override system versions. You could
say use lib "." if that's what you really want. More annoyingly, it's
the current directory of the Perl process, not the directory that the
script was installed into, which makes it completely unreliable. If you
create a program plus some modules for that program to use, it will
work while you're developing, but it won't work when you aren't running
in the directory the files live in.
(/snip)

I don't know what the working dir of one of teh mod_perl processes
would be? The dir of teh first script that is executed? The dir where
the server was started? Anyways, I doubt that this is teh correct way.

All help much appreciated. And big thanks for the great free software
... mod_perl is brilliant!

Daniel




--
Daniel McBrearty
danielmcbrearty at gmail.com

Reply via email to