perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <>
Subject Re: [Patch mp2] PerlSections namespace
Date Wed, 10 Dec 2003 20:45:25 GMT
On Wed, 2003-12-10 at 11:51, 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.

Yes, but this has always been partially broken as it is.

For example:

package Apache::Foo;
$Apache::ReadConfig::Alias = qw(/some/path /some/alias);

If you only do :

PerlModule Apache::Foo

and have no <Perl> sections in your httpd.conf, that code will not

If you have more than one <Perl> section, you'll get warnings about
re-defining an Alias directive for the same location, as the content of
Apache::ReadConfig:: will be read and processed for every <Perl> block.

> 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.

Can you give me one such example ?

I can imagine a <Perl> section in a <virtualhost> block might not (yet)
have access to the right Apache::Server object to add it's configuration
to... Is that what you mean ?

> --Geoff
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)    F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'

View raw message