perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: perl sections howto?
Date Tue, 20 Jan 2004 21:06:55 GMT
Philippe M. Chiasson wrote:
[...]
>>You mean you have moved the contents of that <Perl> section to a perl file and

>>expect it to work? It has no idea what %main::Location is. It needs to be in 
>>the special Apache::ReadConfig namespace. like:
>>
>>   $Apache::ReadConfig::Location{....
>>
>>though I think Philippe has changed things recently and I'm not sure whether 
>>the above will work.
> 
> 
> Yes, this is still the way to do it for now. It should be considered
> somewhat deprecated, but still works. 

BTW, should one load Apache::PerlSections if they don't use <Perl>, but 
$Apache::ReadConfig::? If they don't trigger that load of Apache::PerlSections 
(Which happen automatically on <Perl>) their config will be ignored, no?

>>Philippe, what's the current state of things with perl section namespaces, 
>>when people want to add config from perl, rather than <Perl> sections? Should

>>they do something like:
>>
>>   my $file = __FILE__;
>>   my $namespace = "Apache::ReadConfig\::$file";
>>   ${"$namespace\::Location"}{foo} = {...};
>>
>>We need to document this issue.
> 
> 
> No need for this, really.  In the near future, playing directly with
> %Apache::ReadConfig:: _will_ be deprecated and issue a warning of some
> sort. But before that will happen, there will be a nice way to feed
> hashes-like configuration like:
> 
> $Location{'~ .*log$'} = {
>        SetHandler => "perl-script",
>        PerlResponseHandler => "Blogum::UserLog",
>        PerlOptions => "+ParseHeaders",
>        Allow => "from all",
>        };
> 
> Apache::PerlSection->read_hash(\%Location);
> 
> See the full thread about this future feature here:
> 
> http://marc.theaimsgroup.com/?t=107100040400003&r=1&w=2

Aha, right, I forgot about this new cool feature ;) What would it take to 
convert the above thread into real docs? People can't benefit from the code 
they don't know how to take the advantage of.

__________________________________________________________________
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


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Mime
View raw message