Stas -- On 2004-02-26, Stas Bekman <[EMAIL PROTECTED]> 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