Sören Stuckenbrock wrote:
>>>Nope, using:
>>>
>>>    Alias /contest /www/u-dev/contest
>>>    PerlModule Apache::Registry
>>>    PerlModule Apache::DBI
>>>    PerlTaintCheck On
>>>    <Location /contest>
>>>       SetHandler perl-script
>>>       PerlHandler Apache::Registry
>>>       PerlSetVar BlaTest BlaVal
>>>       PerlRequire /www/u-dev/contest/mod_perl_init.pl
>>>       Options ExecCGI
>>>       PerlSendHeader Off
>>>       allow from all
>>>    </Location>
>>>
>>>doesn't work any better...
>>
>>As the folks said you need to use $r->dir_config if you want to pull
>>the  Location specific value.
> 
> 
> Does this mean I have to add this to my scripts directly and can't do it at
> Server-Startup in my startup.pl?

Those set in the Location aren't accessible via $s. A simple reason is 
in the following example:

  <Location /A>
     PerlSetVar BlaTest BlaValA
  </Location>
  <Location /B>
     PerlSetVar BlaTest BlaValB
  </Location>
how $s is supposed to know which one do you want?

So if you need to access dir_config at the server startup, you must 
define PerlSetVar at the top level (or vhost) and access with 
$s->dir_config()

If you define within Location, you can only get to these at the request 
time.

Another possible workaround is to use Perl to create the configuration 
and in this case you can do whatever you want with the configuration 
hash that you have created, as you can store and reuse that data at the 
startup or during the requests, see the configuration chapter in the guide.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to