You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Christopher H. Laco" <ch...@threetech.com> on 2002/04/02 01:11:32 UTC

Global Config Module

I have a Perl Module that loads configuration data from various sources,
ldap, ini, xml, etc.  It was originally designed for batch file usage, but
I want to start using it in some new mod_perl commerce site development
I'm working on.

Barring the usual global variable issues, what's the best approach to
loading configuration data and having it available to all modules/scripts
running under mod_perl?

If I use the module in startup.pl, and have it load all of it's data at
startup, it that the instance all child processes will use?

Or would it be wiser to have the module save it's settings into ENV
variables instead?

On a side note, I'm fairly comfortable with Perl/OOP at the
batch/command/cgi level, but the where's and whens of mod_perl still leave
me a bit unclear.

Thanks,
-=Chris



Re: Global Config Module

Posted by Perrin Harkins <pe...@elem.com>.
Christopher H. Laco wrote:
> If I use the module in startup.pl, and have it load all of it's data at
> startup, it that the instance all child processes will use?

Yes, that's the best way to do it.

> On a side note, I'm fairly comfortable with Perl/OOP at the
> batch/command/cgi level, but the where's and whens of mod_perl still leave
> me a bit unclear.

It's mostly a question of understanding the lifecycle of the Apache 
server.  You'll get it.

- Perrin