You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Mark Stosberg <ma...@summersault.com> on 2004/03/21 22:57:14 UTC

Re: [mp1] Newbie: figuring out Apache::Reload with relative paths

Stas --

On 2004-02-26, Stas Bekman <st...@stason.org> wrote:
> Mark Stosberg wrote:
>> Hello,
>> 
>> I'm a new modperl user, and I'm trying to figure out the joy that is
>> Apache::Reload.
>> 
>> I keep having an issue where it can't find the modules to reload,
>> apparently due to relative path names. 
>> 
>> In my httpd.conf, I use SetEnv to set the explicit paths I want. 
>> However, it appears that the relative 'use lib' paths that appear 
>> in code have precedence.
>> 
>> It's possible I could remove all these, and only set the path from
>> httpd.conf and my shell environment (for command line module testing).
>> 
>> Is there a simpler way to make Apache::Reload work when there are
>> relative 'use lib' paths in the code?
>> 
>> Since I'm new at this, It's possible I missed some documentation on this
>> topic, and would happily accept a pointer to that if so.
>
> http://perl.apache.org/docs/2.0/api/Apache/Reload.html#Description
>
> ...
> Note that Apache::Reload operates on the current context of @INC. Which means, 
> when called as a Perl*Handler it will not see @INC paths added or removed by 
> Apache::Registry scripts, as the value of @INC is saved on server startup and 
> restored to that value after each request. In other words, if you want 
> Apache::Reload to work with modules that live in custom @INC paths, you should 
> modify @INC when the server is started. Besides, 'use lib' in the startup 
> script, you can also set the PERL5LIB variable in the httpd's environment to 
> include any non-standard 'lib' directories that you choose. For example, to 
> accomplish that you can include a line:
>
>    PERL5LIB=/home/httpd/perl/extra; export PERL5LIB
>
> in the script that starts Apache. Alternatively, you can set this environment 
> variable in httpd.conf:
>
>    PerlSetEnv PERL5LIB /home/httpd/perl/extra

Thank you very much for your prompt and helpful to reply.

Just to add a bit more to this thread:

I did follow this advice about setting up @INC at server startup time.
However, that didn't seem to change my results. What did seem to help
was relying on these declarations exclusively-- I removed my relative
'use lib' calls in the code and had less problems.

	Mark

-- 
http://mark.stosberg.com/ 


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp1] Newbie: figuring out Apache::Reload with relative paths

Posted by Stas Bekman <st...@stason.org>.
Mark Stosberg wrote:
[...]
>>>Is there a simpler way to make Apache::Reload work when there are
>>>relative 'use lib' paths in the code?
[...]
> Thank you very much for your prompt and helpful to reply.

You're welcome, Mark ;)

> Just to add a bit more to this thread:
> 
> I did follow this advice about setting up @INC at server startup time.
> However, that didn't seem to change my results. What did seem to help
> was relying on these declarations exclusively-- I removed my relative
> 'use lib' calls in the code and had less problems.

I haven't seen such a behavior before. I'll need a reproducable test case if 
you want me to look at it. In case you would like to submit one, Geoff has 
kindly prepared a skeleton perfectly suitable for this purpose:
http://perl.apache.org/~geoff/bug-reporting-skeleton-mp1.tar.gz
also linked from:
http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html