My offering only changes one setting at a time.

Yes, there is something better, but what it is exactly depends on how complex your parameters are, what kind of validations you'll want to be doing on them, and so on. But the baisic thing about configuration is that if they are in a data file, you can give them to someone who isn't familiar with Perl syntax for editing and they have less chance of breaking things if they leave off a semicolon somewhere.

Very often INI-style config files win over thanks to their simplicity. Take a look over at CPAN -- they have plenty of modules that handle this format. My personal favorite is Config::Tiny, but shop around. (If your config data is flat, for example, you might not like Config::Tiny's "_" level.)

For more complex data — long text, arrays, maps and so on — YAML is a nice choice. It also has a Perl module to handle it. See if you like it better! (Some people dislike its sensitivity to indentation.)


In reply to Re^3: Changing parameters by gaal
in thread Changing parameters by sparkel

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.