Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 70842 invoked from network); 20 Jan 2008 05:43:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jan 2008 05:43:52 -0000 Received: (qmail 37390 invoked by uid 500); 20 Jan 2008 05:43:38 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 37374 invoked by uid 500); 20 Jan 2008 05:43:38 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 37363 invoked by uid 99); 20 Jan 2008 05:43:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Jan 2008 21:43:37 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.86.89.69] (HELO elasmtp-mealy.atl.sa.earthlink.net) (209.86.89.69) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jan 2008 05:43:09 +0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=eZ8IlogLNJmfng+i9sJDw2NtMx1AKD66Ez6oYLnhgLOvSU/6R7jHHyBQ0wtqq4cc; h=Message-ID:Date:From:Reply-To:To:Subject:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:X-ELNK-Trace:X-Originating-IP; Received: from [209.86.224.49] (helo=elwamui-sweet.atl.sa.earthlink.net) by elasmtp-mealy.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1JGSxf-0004n5-8b for modperl@perl.apache.org; Sun, 20 Jan 2008 00:43:15 -0500 Received: from 68.167.204.78 by webmail.pas.earthlink.net with HTTP; Sun, 20 Jan 2008 00:43:14 -0500 Message-ID: <24584763.1200807794210.JavaMail.root@elwamui-sweet.atl.sa.earthlink.net> Date: Sat, 19 Jan 2008 21:43:14 -0800 (GMT-08:00) From: c chan Reply-To: c chan To: modperl@perl.apache.org Subject: Re: question on startup.pl overriding perl search path Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: EarthLink Zoo Mail 1.0 X-ELNK-Trace: ef3b341c661d477347de782ae9523c31239a348a220c260969e2ef59bcb2ca735d727e8606a76f5493caf27dac41a8fd350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 209.86.224.49 X-Virus-Checked: Checked by ClamAV on apache.org -----Original Message----- >From: Adam Prime >Sent: Jan 18, 2008 6:22 AM >To: c chan >Cc: modperl@perl.apache.org >Subject: Re: question on startup.pl overriding perl search path > >c chan wrote: >> 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? > >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 > >http://perl.apache.org/docs/2.0/user/config/config.html#C_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. > >Isn't PerlSetEnv part of mod_perl? In which case, no that wouldn't work >if you'd removed mod_perl 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. - Clement > >> 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 > >Adam