Hi,

I'm trying to configure a PerlRequire directive in a <Perl> section of
an .htaccess file. This is done so that I can have several directories
(one per VirtualHost) load a different PerlRequire startup without
resorting to absolute paths for the startup for each VirtualHost.

Since FindBin doesn't work for much of anything under mod_perl the
solution I'm trying in the .htaccess file is roughly:
<Perl>
        my $dirroot = $0;
        $dirroot = s/\.htaccess$//;
        $PerlRequire = $dirroot . "modperlstartup.pl";
</Perl>

However this results in the server spinning off into never-never land as
soon as the first mod_perl enabled CGI from the directory is loaded. If
I load the PerlRequire outside the perl section (using the exact
absolute path generated by the code above) everything is fine.

Does anyone have any suggestions? Is it safe to add a PerlRequire in a
<Perl> section? I see no mention of it anywhere, but then again I also
see no examples that do it.

More generally is there a better/correct way to do this? All the
examples I can find in Stas Bekman's (excellent BTW) guide always use
absolute paths for the startup files and any "use lib" pragmas. What I
really need is a way to modify the path to the startup and the path to
lib on the basis of the VirtualHost and I'd like to avoid hardcoding the
paths. 

Thanks,

Alex



--
Alex Harper                                    BroadJump, Inc.
[EMAIL PROTECTED]                    Configuration Manager

Reply via email to