perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [MP2] failed to resolve handler `Apache::PerlSections'
Date Mon, 08 Dec 2003 18:15:08 GMT
Philippe M. Chiasson wrote:

>>>>>The problem seems to be as following: Apache::Status somehow 
>>>>>autovivifies Apache::PerlSections stash, while Apache/

>>>>>wasn't loaded yet. That's why preloading Apache::PerlSections solves 
>>>>>the problem. Our code does not attempt to load packages whose stashes

>>>>>exist, which is obviously wrong. I'll post a patch soonish. I think 
>>>>>instead of checking for the stash, we need to check %INC.
> [...]
>>>I think it at least gives users more control, rather than having obscure 
>>>problems when an autovivified stash will prevent the package loading. 
>>>Like in the case posted by Enrico.
>>Or may be we should do the following:
>>If the package is not loaded (not in %INC), try to load it, but don't bail out 
>>if it fails (like in the case with Unloaded). Next try to lookup the stash, if 
>>it's found (which should be the case with Unloaded, since Loaded will load it) 
>>, then move on, and only if the stash is not found bail out with the loading 
>>failure error?
> Sounds to me like a pretty good way to do what the user would expects
> ;-) But I wonder, how exactly does Perl do this internally when I do
> "use Module", and could we not reuse that ?

It only checks %INC.

perl -le '$Foo::Bar::x = 1; require Foo::Bar'
Can't locate Foo/ in @INC

We could do the same, but then we will have to drop the 
magic-behind-the-scene-loading of Foo::Bar when Foo::Bar::handler is 
configured in httpd.conf. Currently we require to preload the module 
explicitly only if a different from ::handler sub is used. (And a few other 
cases, like filters)

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

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

View raw message