perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: removing PerlLoadModule directive handler requirement
Date Wed, 21 May 2003 02:35:09 GMT
Geoffrey Young wrote:
> 
>> You know, it seems that PerlLoadModule is a misleading name. It 
>> suggests that its purpose is to load a module. 
> 
> 
> well, in some sense it does - it's the Perl equivalent of LoadModule 
> which, in part, populates the module record and makes it possible to 
> handle directives. the problem, I think, is in having the code for 
> PerlLoadModule so specific to directive handlers - there are clearly 
> other reasons you might want to invoke Perl early, so limiting that 
> behavior to directive handlers doesn't seem right.

But you just said by yourself that it's mnemonic to LoadModule, not starting perl.

> in thinking about it, I like the name, so long as it does actually load 
> the module and make it possible to have the Perl equivalent of module 
> init - calling post_config stuff, handling directives, registering 
> providers, etc.  in truth, I don't understand why PerlModule behaves the 
> way it does now, but in changing behaviors between mp1 and mp2 you've 
> lost the ability to do module init stuff.

mod_perl 2.0 tries to pospone the starting of perl, and if doesn't hit <Perl > 
sections or PerlLoadModule will do that only in the open_logs phase (which 
comes after the config, making the startup faster (remember that config phase 
is running twice).

> I think what I'd like to see is the directive handler support stripped 
> away from the PerlLoadModule implementation a bit, making PerlLoadModule 
> equivalent to PerlModule except that PerlLoadModule starts perl on 
> demand rather than when required.  directive handlers would be noted to 
> require PerlLoadModule, in much the same way as mp1 requires PerlModule 
> over simple use() statements.

Obviously we need to do something to do the init stuff. But doing it in
PerlLoadModule is simply wrong, even though it happens to work. Look at the 
implementation and you will see why (e.g. you don't want to register a new 
module, just because you want to start perl early).

I'd rather see a new directive PerlFooModule, which maps to PerlModule 1:1, 
but triggers an early startup. e.g. PerlModuleNow/PerlRequreNow

__________________________________________________________________
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