You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by E R <pc...@gmail.com> on 2010/12/01 23:51:11 UTC

use Apache::Constants / mod_perl2 / command line

Here's the problem I'm trying to solve:

I have a lot of mod_perl 1.x source code that uses Apache::Constants.
We have just moved to mod_perl2, and I'd like to be able to
compile-check the code on the command line. In our httpd.conf we are
using Apache2::compat so we don't have to change all the constant
references to Apache2::Const.

However, to compile check the code I can't use Apache2::compat since
that seems to require that you are running in a mod_perl environment.
Are there any other quick-n-dirty solutions to this problem that I've
overlooked? I'm about to create MyOwnApache::Constants package which
emulates Apache::Constants using Apache2::Const. It seems that
Apache2::Const is usable outside of the mod_perl environment.

Running perl -MApache2::compat results in the error: Undefined
subroutine &Apache2::ServerUtil::restart_count called at
..../Apache2/compat.pm line 76.

Re: use Apache::Constants / mod_perl2 / command line

Posted by Fred Moyer <fr...@redhotpenguin.com>.
I usually compile check my mod_perl app by starting it up.  If you
have use'd all your core modules in startup.pl, they will be loaded,
and the application will fail to start if there are compilation time
errors.

On Wed, Dec 1, 2010 at 2:51 PM, E R <pc...@gmail.com> wrote:
> Here's the problem I'm trying to solve:
>
> I have a lot of mod_perl 1.x source code that uses Apache::Constants.
> We have just moved to mod_perl2, and I'd like to be able to
> compile-check the code on the command line. In our httpd.conf we are
> using Apache2::compat so we don't have to change all the constant
> references to Apache2::Const.
>
> However, to compile check the code I can't use Apache2::compat since
> that seems to require that you are running in a mod_perl environment.
> Are there any other quick-n-dirty solutions to this problem that I've
> overlooked? I'm about to create MyOwnApache::Constants package which
> emulates Apache::Constants using Apache2::Const. It seems that
> Apache2::Const is usable outside of the mod_perl environment.
>
> Running perl -MApache2::compat results in the error: Undefined
> subroutine &Apache2::ServerUtil::restart_count called at
> ..../Apache2/compat.pm line 76.
>