IMO, XML is too verbose for configuration files meant to be edited by humans. If the config will only be read/written by another program, then it really doesn't matter what format it's in.

One of the most irritating things to me about XML configuration files is that a key/value pair can be expressed as an attribute or an element without any loss of information. I don't think that TMTOWTDI should apply in configuration files :-)

I think the INI format strikes the best balance among compactness, readability and expressiveness. I'd venture to say that anyone who would be editing a configuration file knows the format, and it's very simple to edit.

The other end of the spectrum is serialized (via Data::Dumper or Data::Denter) Perl data structures. These are extremely expressive, very compact but readable only to folks who know Perl fairly well. Depending on your audience the cost of this can vary.

Because of their expressiveness, Perl data structures also have the tendency to lull you into putting very complicated data structures in your configuration. IME, this eventually winds up biting you in the rear.

Chris
M-x auto-bs-mode


In reply to Re: AppConfig or XML::Simple for All my modules? by lachoy
in thread AppConfig or XML::Simple for All my modules? by princepawn

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.