perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [Patch mp2] PerlSections namespace
Date Wed, 10 Dec 2003 20:06:50 GMT
Geoffrey Young wrote:
>>Am I
>>correct to say that people don't need to work directly with
>>Apache::ReadConfig? I think the only place this is needed when people
>>mix config with non-config perl code in <Perl>, so that they need to
>>switch 'package Apache::ReadConfig;' to start feeding things into the
> no, you can also add entries directly to the Apache::ReadConfig namespace in
> order to add configuration data.
> package Apache::Foo;
> $Apache::ReadConfig::PerlFixupHandler = "Apache::Foo";
> sub handler { };
> now, PerlModule Apache::Foo automatically installs a PerlFixupHandler :)
> there are a few modules on CPAN that do this, IIRC.
> it's similar to Apache->server->add_config() in mp2, but I've found that
> method really not worth the trouble - it's goverened by overrides, so you
> can never really trust that it will add the configuration data you pipe into it.

That's exactly why people do *not* need to work directly with 
Apache::ReadConfig - they have Apache->server->add_config() (and we are 
talking about mp2). If people can achieve the same thing without using
Apache::ReadConfig, I think it should be completely deprecated, which avoids 
the problem altogether. That's why I wanted to know if there are cases where 
it's absolutely needed and you can't go without it.

I think this case:

   package Foo;
   my $whatever = whatever();
   package Apache::ReadConfig;
   $User = $whatever;

can now become:

   package Foo;
   my $whatever = whatever();
   Apache->server->add_config("$User $whatever");

Though it's probably not going to be simple for creating more complex config 
directives, e.g complex containers. Can you think of a good solution for that 

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message