(I'm not subscribed, please CC: [EMAIL PROTECTED])

Hello everyone. I'm using mod_perl and Apache for a typical web project.
Each piece of mod_perl code will need to be able to access a lot of
configuration info. I guess we'll store the configuration info in a
plaintext file. This configuration info will need to be changed by the
admin (whether by editing the config file or using a web interface).
However, I'd rather not parse the entire config file for every single
request (the config file may be very long, and/or consist of multiple
files). Is there any way to parse the config file once, store the
results, and make the data available to any of my code?

I was thinking of putting the parsing code into a Perl module, and `use`ing
the module in startup.pl . But will this ensure that the file is only
parsed once? When subsequent scripts 'use' the module, won't this require
parsing the file again? Or if the parsing of the file is separated into
a subroutine, how will the results be stored so that they can be
accessed quickly by any code which uses the module?

Sorry if I'm explaining myself poorly - feel free to ask for clarification.

One more thing - it would be nice to be able to re-parse the config file
when someone sends Apache a certain signal. Is this possible?

Thanks in advance,

Neil

-- 
Neil Conway <[EMAIL PROTECTED]>
Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
Encrypted mail welcomed

It should be first patch, not first post.
        -- Alan Cox

PGP signature

Reply via email to