On Mon, 6 Aug 2001, Bill Moseley wrote:

> In a previous post today I mentioned how I was running mod_perl from the
> build directory by setting a PERL5LIB.
>
> I seem to need to add:
>
> <perl>
> </perl>
>
> at the top of httpd.conf.  Otherwise I get:
>
> Apache.pm version 1.27 required!
> /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Apache.pm is version 1.26
>
> I use <perl> sections farther down in httpd.conf, but I seem to need it at
> the very top.  If a PerlTaintCheck On comes before the <perl></perl> then I
> get that error.
>
> Why is that?

According to perlrun manpage, PERL5LIB and PERLLIB vars are ignored when
the taint mode is enabled. This is not the situation with mod_perl, where
the two vars do take an effect.

However it's possible (I didn't look at the code) that during the config
processing normal Perl rules still apply, and therefore PERL5LIB gets
ignored if PerlTaintCheck is set to On.

Your solution worked because <perl></perl> loads Apache.pm before the
tainting is enabled.

I think you just need to adjust your startup.pl to put the local libs
(from the mod_perl build) first (assuming that your startup.pl is loaded
as early as possible).

If you want your code to be copy and paste ready, what you can do is to
create:

test-startup.pl:
use lib qw( local libs here);

and in your production startup.pl:

eval { require "test-startup.pl"; }

so if the file is not there, it'll be just ignored. Now you keep this file
only around your test dir, without putting it into CVS (assuming that you
use CVS ;).

Hope this helps to resolve the issue.


_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Reply via email to