In this node I said that for large config files (a condition of the OP) that I preferred XML to many other mechanisms including oodles of name=value pairs. Later on in the thread, in response to comments about the possibilities of misconfiguration with XML files, I suggested using a well-written DTD.

I suggested this because I believe that if a DTD is well-written, it can be validated by an external program and the config file can be validated against the DTD by an external program. They can also be validated by the app itself, but that may be undesirable. Some issues might be: long startup time to discover a bad config file, a poorly written app that does not check all of the config file before using it and dies into the running when errors are encountered.

For me, though, I like the idea of being able to tell a running program (e.g. via a button or signal) to re-read a config file to cause changes to occur. It is nice if the file is externally validated before it is reread. Not that everyone has such a need, but in the development phase, it is sometimes nice. Also, I like being able to have an external description of the config file (a DTD) that I can keep in one place on a network that many apps/validators can share. It sure makes maintenance easy. (Yes, one could do that with other formats, but it is "built in" to the whole DTD concept.) I also like the idea of the whole config file being sucked into the app as a large data structure I can access "easily".

Anyway, I would like to know what others think about configuration files.


In reply to Config Files Redux by traveler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.