Geoffrey Young wrote:
> Grant McLean wrote:
> >>>I know I can use $r->dir_config() to access parameter values
> >>>set in the config file with PerlSetVar, but is it possible to
> >>>access the value of generic Apache configuration directives?
>
> you have very few options here.  one of which is to do
> 
> <Perl>
>    $Apache::Server::SaveConfig = 1;
>    $DirectoryIndex = 'index.html';
> </Perl>
> 
> then you can access the variable in your script as 
> $Apache::ReadConfig::DirectoryIndex
> 
> you can also use directive handlers to override the DirectoryIndex 
> directive and stash it someplace you know about.  an example of how 
> that can be accomplished is here:
> 
> http://www.modperlcookbook.org/code/ch14/Cookbook-MIMEMapper-0.01.tar.gz
>
> the last resort is to plug right into mod_dir's private data.  

Thanks a lot Geoff I was able to bend the MIMEMapper example 
from the cookbook to do exactly what I wanted (eventually).
In the process, I learned a lot about the Apache configuration
API and have come to the conclusion that I can't justify the
added complexity of adding XS to the mix so I'll fall back to
the simple PerlSetVar approach.

Thanks again, your answer was very helpful.

Regards
Grant



Reply via email to