Paul G. Weiss wrote: [...]
The reason this is important is that I'm trying to get Apache::PageKit to run in virtual hosts, and it depends on the availability of PerlSetVar variables on startup.
First of all, why do you expect PerlSetVar to be available at the server startup? The config phase is not completed and the value can be overriden several times by the end of config.
Second, Apache->server always gives you the global (top-level) server, so of course once you move PerlSetVar outside of vhost, you get to see its value.
I think using PerlPostConfigHandler will let you achieve what you want:
PerlRequire /var/www/perl/startup.pl # set value in global scope PerlSetVar foo global <Location /module> SetHandler perl-script PerlHandler Module </Location> <VirtualHost 127.0.0.1:9900> # set value in virtual host scope PerlSetVar foo virtual PerlModule Module PerlPostConfigHandler Module::start </VirtualHost>
package Module;
sub start { my($conf_pool, $log_pool, $temp_pool, $s) = @_; print "Module->start sees foo=" . $s->dir_config('foo') . "\n"; }
(this code is untested, but I think it should do what you want)
The difference is that you get the correct $s object here (which you can't get during the config phase). Sounds like your case can be a useful addition to the existing example:
http://perl.apache.org/docs/2.0/user/handlers/server.html#PerlPostConfigHandler
__________________________________________________________________ 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
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html