The CONFIG:: Guide
This Guide describes the possibilities and usage of the CONFIG:: modules in version V0.99.11 - 18. Jun 2000.
The CONFIG:: package was designed to speed up the configuration file reading in connection with mod_perl enabled CGI scripts. The Key-benefit of this package is the seperation of configuration settings and program code without loosing speed. This is especialy useful for big projects with many coders/maintainers. It also simplifies the seperation of perl-coders, web-designers and database-admins in big projects.
The two main tasks of this package are caching and preparsing.
The caching feature was designed to be used in a Apache/mod_perl envirement, but there is at least one other case in which you can benefit from this feature (this will be coverd in the "Non CGI usage" chapter). In fact, this package doesn't need a Apache or mod_perl envirement.
If a file is first opend with the CONFIG::Plain module, it is also stored in a RAM structure. On the second, third,... open the CONFIG:: module uses the stored data instead of reading it again from disk.
The preparsing feature is able to strip comments out, handle escape-sequences and parse the file into a data structure. The preparsing only takes place if the file was read from disk. In other words the preparsed file is cached, not the plain file from the disk.
So, every access to a already read and preparsed file is just a acces to a RAM structure. There is nearly no difference between accessing a read and preparsed file and accessing a data-structure which was defined in the perl code.
The following chapers will explain how to use this package in order to get maximum performance. It is highly recommended to read the mod_perl Guide for a deeper understanding of this module.