You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Max Kanat-Alexander <mk...@bugzilla.org> on 2006/08/18 20:00:39 UTC

ModPerl::RegistryLoader doesn't compile from the command line

	From any command line, try:

	perl -MModPerl::RegistryLoader

	At least in 2.0.1, that causes this error:

	Bareword "Apache2::ServerUtil::server_root" not allowed while "strict subs" in use at /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/ModPerl/RegistryLoader.pm line 74.

	However, the script properly uses Apache2::ServerUtil, which does
indeed have a subroutine called server_root.

	This is not a problem when Apache uses the module, only when you try to
compile a command-line script that uses ModPerl::RegistryLoader.

	Why would I want to do that, you ask? Well, we have a test suite that
makes sure all our scripts compile. One of those scripts is our mod_perl
startup script, which uses ModPerl::RegistryLoader. So, it would be nice
if it would compile from the command line. There's no reason for it
*not* to compile--I can't figure out why it's failing.

	-Max
-- 
http://www.everythingsolved.com/
Everything Solved: Competent, Friendly Bugzilla and Linux Services


Re: ModPerl::RegistryLoader doesn't compile from the command line

Posted by Max Kanat-Alexander <mk...@bugzilla.org>.
On Fri, 2006-08-18 at 14:03 -0400, Perrin Harkins wrote:
> You can't do that.  These are APIs to apache internals.  They don't work
> without the httpd environment.

	Ah, okay. Thanks for the explanation. Changing it to
Apache2::ServerUtil->server_root would probably at least make it work at
compile-time, I suppose, though.

> You need to use Apache-Test for the mod_perl bits if you want to do
> that.

	Okay, good to know.

	-Max
-- 
http://www.everythingsolved.com/
Everything Solved: Competent, Friendly Bugzilla and Linux Services


Re: ModPerl::RegistryLoader doesn't compile from the command line

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2006-08-18 at 11:00 -0700, Max Kanat-Alexander wrote:
> 	This is not a problem when Apache uses the module, only when you try to
> compile a command-line script that uses ModPerl::RegistryLoader.

You can't do that.  These are APIs to apache internals.  They don't work
without the httpd environment.

> 	Why would I want to do that, you ask? Well, we have a test suite that
> makes sure all our scripts compile.

You need to use Apache-Test for the mod_perl bits if you want to do
that.

- Perrin