Re: question on startup.pl overriding perl search path
>From: Adam Prime <email@example.com>
>Sent: Jan 18, 2008 6:22 AM
>To: c chan <firstname.lastname@example.org>
>Subject: Re: question on startup.pl overriding perl search path
>c chan wrote:[color=green]
>> I use "PerlConfigRequire /var/www/html/mypath/startup.pl" in httpd.conf to recompile all the CGIs. Inside startup.pl, I added the line:
>> use lib qw(. mylib);
>> To me amazement, after all the CGI is precompiled, they start to look into the "." and "mylib" path for loading Perl Modules without even having the line [use lib qw(. mylib);] incorporated in each individual cgi script.
>> Can someone explain to me why this is the case? Is the mod_perl startup.pl script simply becomes the parent apache process for all the preloaded CGIs?[/color]
>This is normal. Under mod_perl the perl interpreter just keeps running
>until the apache child dies your modified @INC stays modified. I'm sure
>someone with a better understanding of the internals can give a more
>detailed 'why'. FYI though, you should probably use PerlPostConfigRequire
>> If I remove mod_perl, can I use the
>> PerlSetEnv -I/var/www/html/mypath -I/var/www/html/mypath/lib
>> to achieve the same result.[/color]
>Isn't PerlSetEnv part of mod_perl? In which case, no that wouldn't work
>if you'd removed mod_perl[/color]
Thank you for your clarification. To make the CGI scripts both work under Apache and mod_perl, I put the "use lib qw(...);" in everyone of them.
>> This will make a profound effect on my CGI directory because whatever I installed will no longer affect the system perl module search path. In effect, this will make my application self contained and making trouble shooting make easier.
>> - C Chan[/color]