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 Sat, 06 Dec 2003 04:46:31 GMT
Stas Bekman wrote:
> Stas Bekman wrote:
>> Stas Bekman 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.
>> It was a bit trickier than I thought, but now the code is even simpler 
>> to follow. This should solve your problem Enrico. 'make test' pass 
>> 100% with this patch.
> So what do you think? Should we go with this change (checking %INC) or 
> not? The only drawback I can think of is that if you define a handler 
> without loading its package you may need to mess with %INC as in the 
> example below:
> httpd.conf
> ----------
> PerlModule Loaded
> PerlWhateverHandler Loaded::handler
> PerlWhateverHandler NotLoaded::handler
> (which contains Loaded and also NotLoaded packages)
> ---------
> package Loaded;
> ...
> sub handler {...}
> ...
> package NotLoaded;
> $INC{''} = __FILE__;
> sub handler {...}
> 1;
> if %INC is not updated to include the key '', mp2 will try 
> to load, which doesn't exist.
> 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?

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

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

View raw message