Problems? Is your data what you think it is? | |
PerlMonks |
Re: Passing Arguments to Perl Modules during Apache Startupby echo (Pilgrim) |
on Sep 13, 2001 at 11:47 UTC ( [id://112128]=note: print w/replies, xml ) | Need Help?? |
Now, I've looked into using PerlSetVar, PerlSetEnv and PerlPassEnv. The problem is, these directives only seem to work when called through Apache via a browser. But when Apache is initially loading, Apache does not seem to pass any of this information to modules as it is loading them. Use PerlSetVar the usual way: PerlSetVar foo barThen in your startup.pl file, access them like this: my $config = Apache->server->dir_config('foo');On a side note, it's best if possible to stay away from PerlSetEnv/PerlPassEnv, because setting up the environment at request time is costly. If you don't use the %ENV at all in your modules then you can save some cycles by configuring PerlSetupEnv Off. Just to add some spice to the this problem, I definitely would like to keep the solution to this within the httpd.conf file. Check out Perl Sections: you can directly set yourp ackage variables from httpd.conf:
In Section
Seekers of Perl Wisdom
|
|