perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [MP2] Bug ? Recursion in parsing of PerlSection (Subroutine xxx redefined)
Date Tue, 27 May 2003 04:00:14 GMT
Philippe M. Chiasson wrote:
> Is evaluated in Apache::ReadConfig's namespace, even if it does nothing.
> Once again Apache::PerlSections is called in with Apache::ReadConfig as
> the namespace
> This handler will once again see
> @Apache::ReadConfig::include = "foo.conf";
> and here starts the recursion.
> This is a hairy problem indeed. I realized this partially in the past,
> when re-introducing PerlSaveConfig but didn't think of this particular
> recursive possibility.
> The way I see it, there is only a few ways to proprely fix this.
> 1. To use one _extra_ namespace to save the config into, if
> PerlSaveConfig is specified, and delete or move elements from
> Apache::ReadConfig as it is being processed.
> 2. To use automatically-generated namespaces for each <Perl > sections,
> like ModPerl::Registry, like Apache::ReadConfig::blocknnn or something.
> I personally prefer solution #2.
> Ideas/suggestions ? If not, I'll probably give a shot at implementing #2
> sometime this week.

Do you have to process again the include directive? If not, why not use the 
same solution as used by require, which stores name=>path of loaded files in 
%INC. I don't know where you currently store the processed result of include, 
but if you lose it, why not store it in %Apache::ReadConfig::INC, with key 
being the included filename and value the result of the include? Though need 
to ensure that we have no duplication when two files with indentical names 
(but located at different paths) are included. Should probably resolve these 
to a full path? or append the parent's path?

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

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

View raw message