Hi all,

When I call to this function:
sub config_get {
  my $s = Apache2::ServerUtil->server;
  print STDERR "ref(s): " . ref($s)) . "\n";
  my $cfg = Apache2::Module->get_config(__PACKAGE__, $s);
  return $cfg;
}

I get this output:
ref(s): Apache2::ServerRec
[error] [client 127.0.0.1] Apache2::Module::get_config: s is not of type
Apache2::ServerRec

By contrast I expected it to work as cited in
http://perl.apache.org/docs/2.0/user/config/custom.html#Creating_and_Using_Custom_Configuration_Directives
or used in these examples:
https://svn.apache.org/repos/asf/spamassassin/branches/check_plugin/spamd-apache2/lib/Mail/SpamAssassin/Spamd/Apache2/Config.pm
http://cpan-search.sourceforge.net/Apache2/DocServer.pm.html
http://mail-archives.apache.org/mod_mbox/perl-modperl/200606.mbox/%3c448a0267.5030...@taperfriendlymusic.org%3E

Can be anything wrong with my code?

Note that ref($s) successfully returns "Apache2::ServerRec". However the
code crashes anyway.

Also I've tried with
my $cfg = Apache2::Module->get_config($s);
and it runs sucessfully, but I'm not sure whether omitting that parameter
may be convenient for the purpose of the code.

Thank you very much.

Reply via email to