I'm looking for a lightweight config parsing module to use in a mod_perl application. The obvious answer seems to be: just use PerlSetVar directives inside of Apache's own config file(s). However, I'd like to keep configuration information that's not mod_perl specific (for example, things like database connection parameters) out of the Apache config files. I'd like this info to be available to a startup script called from httpd.conf, as well as available outside of Directory or Location sections, but PerlSetVar info is normally only accessible inside a request (I think). Also, I'd ideally like to be able to update my config files and have them reparsed without having to restart Apache.
First of all, feel free to tell me that the above approach is a bad one and that I should stick with Apache's own config parsing features. But, if not, read on ...
I have some hand-rolled code that I'm using at the moment. It involves a globally available tied hash that caches the config parameters, then stats the config file each time a parameter is fetched. If the config file's modification time has changed, it reparses the file; otherwise it uses the cache. However, I'd prefer to use a module from CPAN for all the usual reasons. I've browsed through CPAN, as well as Super Searched here on perlmonks, and there are plenty of modules that will do the config parsing with no problems. However, since I haven't used any of these modules in a production environment, here's what I'm ultimately looking for in a module:
It would be nice to use AppConfig, since I'm already using Template Toolkit, meaning that AppConfig is already installed. However, I'm not familiar with it enough to know about its memory requirements and ability to reparse changed files. Again, there are plenty of others which meet the first requirement, but I'm not sure about the other two.
Any suggestions?
-jehuni
In reply to Config parsing module for mod_perl app? by jehuni
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |