http://www.perlmonks.org?node_id=585775


in reply to Config Files Redux

Validation of the config file should only be a problem if it is not machine generated. If you are worried about validation then you are implying hand editing, and hand editing a large XML document is no fun at all! XML is, IMO, not suitable as a configuration file format intended for hand editing. Conventional .ini type files are much better in that regard and are generally pretty robust for parsing because their syntax is simple.

The underlying file format is completely independent of whether a file can be reloaded or loaded into a data structure. Many of the CPAN configuration modules do exactly that with a plethora of different configuration file types.

For persisting state where an application writes and reads the configuration files used XML can be usefull because it provides a somewhat human readable structure and there are standard tools around for viewing XML in a structured form. For exchanging information between different applications and using a DTD for mediation XML is very good. For large lumps of human editable configuration there are better solutions.


DWIM is Perl's answer to Gödel