perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: removing PerlLoadModule directive handler requirement
Date Wed, 21 May 2003 12:19:06 GMT


Stas Bekman wrote:
> 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.

yes.  but in Apache, loading a module runs the module init (at least it did in 1.3) - when

I load a Perl module I want stuff to run too.  the fact that Perl is started "early" is 
irrelevant - to me, PerlLoadModule should load the module in a Perl sense, which means 
running import() and other stuff immediately, the same as what happens when Perl loads a 
module via use() (eg, it's not deferred until later). the deferred status of PerlModule is

really more like module "registering" than it used to be (remember, the old explanation 
was that PerlModule was like use() and PerlRequire like require(), which is now no longer

strictly true, since the real use() doesn't happen immediately when the use() is seen).

> 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

well, I guess we disagree then.  personally, I think the wrong part is using 
PerlLoadModule for _only_ directive handlers, when all kinds of other stuff can be 
coded/required to happen when a module is loaded.

but I'm not really in a position to rewrite a massive patch to fix it all, so I guess I'll

keep quiet for now.

--Geoff


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


Mime
View raw message