leocharre has asked for the wisdom of the Perl Monks concerning the following question:
I'm developing some web software. I'm testing on multiple apache/linux servers. I have a lib dir with my testing modules for each account, and for each cgi file, I have a use lib '/misc/home/path/lib';
So each account's cgi files need a diff use lib path. It's almost ok, I can run cli perl on these guys, still.. it's a pain.
Here's what I'm looking into..
Am I missing some more obvious solution? Keep in mind there is no root access.
udpate
Adding this to the .htaccess file:
SetEnv PERL5LIB '/path/you/want';
Works sometimes. It will not work if you use Taint mode, so.. no cigar.
Another interesting tidbit is Baselib.pm, but it requires BaseLib be installed .. so.. catch22 :).
It seemed intuitive to do use lib "$ENV{HOME}/lib";, but that is also not reliable. None of these accounts accept that.
One way that works with Taint:
BEGIN { $ENV{DOCUMENT_ROOT}=~m/^([\w\-\/]+)$/i; eval "use lib '$1/../lib';"; } # this is unreliable: #BEGIN { # use lib do { # $ENV{DOCUMENT_ROOT}=~m/^([\w\-\/]+)$/i; # } . '/../lib'; #}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to add web hosting account-wide use lib ?
by shmem (Chancellor) on Jun 21, 2006 at 13:45 UTC | |
|
Re: how to add web hosting account-wide use lib ?
by sgifford (Prior) on Jun 21, 2006 at 15:58 UTC | |
by leocharre (Priest) on Jun 21, 2006 at 16:50 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |