or something like it.<site> <server name="servername1" path="/path/to/logfile"> <server name="servername2" path="/path/to/logfile2"> </site>
Alternatively, use some other data format, like YAML:
--- #YAML:1.0 - Logfile: '/path/to/logfile' Server: Servername1 - Logfile: '/path/to/logfile2' Server: Servername2
Which was generated from
YAML::LoadFile will read that back.use YAML; DumpFile("config.yaml",[ { Server => 'Servername1', Logfile => '/path/to/logfile'}, { Server => 'Servername2', Logfile => '/path/to/logfile2'} ]);
There are countless alternatives in CPAN.
update: I missed the title of your post. Yes there is a module on cpan for parsing apache style config files as VSarkiss noted.
I would not recommend you go that route, though. The apache config file syntax is one of its few weaknesses IMO. Please consider a format that is easier to parse and understand.
In reply to Re: Extracting data from Apache style config files
by Joost
in thread Extracting data from Apache style config files
by wayloud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |