walinsky has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

trying to avoid PerlSetVar in httpd.conf (as it's parsed at request time) (performance) I'm contemplating the idea of using custom Apache configuration directives.

After reading the documentation I'm still stuck with a few questions:
When setting parameters in httpd.conf like:
MyParameter Foo MyOtherParameter Bar
1: do I _need_ to specify a sub for MyParameter and MyOtherParameter
2: how do I retrieve the values for these parameters (in my other perl modules)
3: can I use these parameters for replacing .htaccess files (peeking into other httpd modules) for editing configuration parameters at request time ?
  • Comment on mod_perl - setting globals (and retrieving them), and peeking into other module's configs (avoiding .htaccess)
  • Select or Download Code

Replies are listed 'Best First'.
Re: mod_perl - setting globals (and retrieving them), and peeking into other module's configs (avoiding .htaccess)
by eserte (Deacon) on Nov 17, 2007 at 18:47 UTC
    Why not just use simple global perl variables? In your httpd.conf:
    <Perl> $my::param = "Foo"; </Perl>
Re: mod_perl - setting globals (and retrieving them), and peeking into other module's configs (avoiding .htaccess)
by perrin (Chancellor) on Nov 17, 2007 at 22:06 UTC
    PerlSetVar is plenty fast enough. If performance is the only reason you're doing this, you are wasting your time.