On Thu, Feb 12, 2009 at 9:55 PM,  <shiriru0...@hotmail.com> wrote:
> Is there a way to manipulate @INC without having to use a startup.pl in
> mod_perl2???

Sure.  For example, PERL5LIB.

> As for now, I've created a startup.pl to manipulate @INC that is called when
> the server is launched
> but this has serveral draw backs that i would like to avoid:
> - need to hardcode the path in this file (in plain old CGI relative path
> were ok)

Regarding relative paths, I wouldn't recommend putting your perl
libraries inside of DOCUMENT_ROOT if you can avoid it.

If you have to use relative paths, you want something like what Mark
Hedges suggested.  That should work for ModPerl::PerlRun, where your
code is compiled every time.  For ModPerl::Registry, you'd need to do
something like this:

use FindBin;
unshift @INC, "$FindBin::Bin/../lib";

Unlike "use lib", the unshift will run every time in Registry.  Also,
if you use RegistryPrefork you won't need FindBin at all.  You can
just use '../lib'.

> I've tried also ModPerl::RegistryPrefork but got some tremendous blank pages
> that leaved no log at all.
[...]
> I have absolutely no clue on how to debug this ??

There are a few things I would try:
- Double-check the log file
- Add some warn statements to see how far it gets.
- Examine the communication with the client through a proxy or Firefox plugin.

I think that ModPerl::RegistryPrefork is ultimately where you want to
be, because it will be faster.

- Perrin

Reply via email to