perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Beberle <>
Subject Apache::Directive::conf tree error with mod_perl 1.99x and Apache 2
Date Wed, 17 Nov 2004 08:19:55 GMT
Ok, I've read the documentation and searched the
archives for a similar problem but no luck.  If anyone
has any suggestions, I'd be most grateful.

Here's my situation:

I've got Apache 2.0.46 with mod_perl 1.99_09 (called 
2.0-tobe in the documentation) both of which were
installed by the Red Hat Enterprise installation.

I copied this startup file form the mod_perl docs:

# File: 
use Apache2 ();
use lib '/etc/httpd/lib/perl';

use ModPerl::Util (); #for CORE::GLOBAL::exit
use Apache::compat ();
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::RequestUtil ();

# commented this out because Apache::ServerRec  
# doesn't exist on the server and throws errors

#use Apache::ServerRec (); 

use Apache::ServerUtil ();
use Apache::Connection ();
use Apache::Log ();
use APR::Table ();
use ModPerl::Registry ();
use Apache::Const -compile => ':common';
use APR::Const -compile => ':common';
use CGI qw(-compile :all);


In my perl.conf file, I've added the following lines:

LoadModule perl_module modules/
PerlRequire conf/

# this is a test module
PerlTransHandler Apache::DefaultTrans 

In my test module (modified from the O'Reilly "Writing
Apache Modules" book),  I have the following code:

package Apache::DefaultTrans;
# File: Apache/

use Apache::Const qw(:common);
use Apache::RequestIO ();
use Apache::RequestRec ();
use Apache::Log ();
use Apache::Directive ();

sub handler {
        my $r = shift;
        my $uri = $r->uri;

        my $tree = Apache::Directive::conftree();
        my $document_root =

        $r->filename($document_root  . $r->uri);

This throws the following error:

[error] [client]  Usage:
Apache::Directive::conf tree(CLASS)  at

I've looked up this function in the documentation and
this seems to be the right way to use it.  Oddly, if I
try to stuff some random variable in, like:

my $tree = Apache::Directive::conftree($tree);

the error goes away, but $tree is empty.

Any help is appreciated. Thanks.

Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 

Report problems:
Mail list info:
List etiquette:

View raw message