perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [WISHLIST] Be able to troubleshoot config file with perl -cx as before
Date Wed, 02 Feb 2005 13:28:28 GMT
Dominique Quatravaux wrote:
> Hash: SHA1
> Stas Bekman wrote:
> |
> | This is not going to work, since it requires a running mod_perl.
> I understand this, and my [WISH] was that it be taught not to.

got you :)

> | I'm pretty sure the perl -cx worked in mp1 only in certain cases,
> | where no mod_perl symbols were used. Try the modperl1 config where
> | you use some Apache module and you will get the same problem.
> |
> Since they do nothing too fancy in their BEGIN blocks, all modules in
> mod_perl 1 except Apache::test compile OK from /usr/bin/perl (even
> though calling any of their subs could obviously fail):
> $ for i in `dpkg -L libapache-mod-perl | grep 'pm$' | perl -pe
> 's|/usr/lib/perl5/(.*).pm|$1|;   s|/|::|g;'`; do perl -M$i -e 1 ||
> echo $i; done
> Can't locate Apache/ in @INC (@INC contains:
> /usr/local/lib/perl/5.6.1 /usr/local/share/perl/5.6.1 /usr/lib/perl5
> /usr/share/perl5 /usr/lib/perl/5.6.1 /usr/share/perl/5.6.1
> /usr/local/lib/site_perl .).
> BEGIN failed--compilation aborted.
> Apache::test

what mp2 modules fail to do so, besides Apache::compat?

> Having just "Apache::Compat" compile OK in mod_perl 2 would be enough
> for my needs.

I see. but since you aren't using Apache::compat during config, why not 
just comment it out. I don't think the described situation justfies 
rewriting this module, to s/use/require/ and remove other compile time 
things, making the code a mess and losing some compile time optimizations.

The solution in fact is simple: just replace your 'use Apache::compat; with:

require Apache::compat if $ENV{MOD_PERL};

in which case it won't be loaded unless run under mod_perl.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message