On Thu, 11 Apr 2002, pascal barbedor wrote:

> I have a problem with Apache::ServerUtil though :
>
> when using $s->dir_config('some') i have this message (and apache segfaults)
>
> "Attempt to free unreferenced scalar at .. line 17"
>
> i have installed modperl through ppd, so have not the t/report procedure
> i am under win2k ppd from theoryx5, ASperl build 631
>
> for now the only lines in httpd.conf concerning modperl are
>
> perlsetvar statpath path
> perlrequire startup.pl
>
> then,
> in startup.pl :
> use Apache2;
> use Apache::ServerUtil();
> use Apache::Const();
>
> use Mymodule();
> ------
>
> in Mymodule.pm
>
> use Apache::ServerUtil;
> my $s=Apache->server;
> [and the incriminated line 17: ] my $base=$s->dir_config('StatPath');

Does the following, or some variation, work?

==================================================================
package Apache::Test;

# PerlModule Apache::Test
# <Location /hello-world>
#   SetHandler modperl
#   PerlResponseHandler Apache::Test
#   PerlSetVar TEST "jdjdsds"
# </Location>

use strict;

# based on t/conf/modperl_extra.pl in the mod_perl-2 sources
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::ServerUtil ();
use Apache::RequestUtil ();
use APR::Table;
use Apache::Const -compile => qw(:common);
use APR::Const -compile => qw(:common);

sub handler {
    my $r = shift;
    my $key = $r->dir_config->get('TEST');
    $r->content_type('text/plain');
    $r->print($key);
    Apache::OK;
}

1;

===========================================================

best regards,
randy kobes


Reply via email to