perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
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
>>config.
> 
> 
> 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:

<Perl>
   package Foo;
   my $whatever = whatever();
   package Apache::ReadConfig;
   $User = $whatever;
</Perl>

can now become:

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

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 
case?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message