perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject a new directive: PerlStartupFile?
Date Fri, 10 Dec 2004 01:21:54 GMT
As a followup to the discussed issue, we need to redefine the concept of:

   "put those things in"

we now need to say:

    "put those things in post_config phase handler"

So users need to do:

PerlRequire ""

use Apache::ServerUtil ();
Apache->server->push_handlers(PerlPostConfigHandler =>
   sub { require "" });

which is not so easy as to say:

   "put those things in"

if the path is not hardcoded or not in INC, for example to do it 
relatively, one needs to write as much as:

use Apache::ServerUtil ();
use Apache::ServerRec ();
use Apache::Process ();
my $s = Apache->server;
my $pool = $s->process->pool;
my $path = Apache::ServerUtil::server_root_relative($pool, "conf");
$s->push_handlers(PerlPostConfigHandler => sub {
     require "$path/" });

So there is a possibility to introduce a new directive: PerlStartupFile 
(feel free to suggest a better name) which will be:

PerlStartupFile ""

which will do:

use Apache::ServerUtil ();
Apache->server->push_handlers(PerlPostConfigHandler =>
   sub { require "" });

internally. and this will eliminate the need for

PerlRequire ""

if you don't want to load any config directives stuff.

after discussing this with gozer on irc we aren't sure this is a good 
idea, as for most people using the old concept will still work. 
So your comments are welcome...

gozer and I think that we could add this directive later on, and just 
document the above code as "best practice" for now.

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

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

View raw message