I use this kind of config.file in order to improve my Perl approach.

If you want to improve your Perl approach, I would recommend using the right technique for the right job. Yes, your config file can be "made to work". But, you have created something that only you can modify or use. I would not expect any of my users to modify this file - there are a lot of arcane syntax issues with it because it is really a Perl program. I see that as a disadvantage.

In general for my INI type config files, I strive for a comprehensible format that a non-Perl person can modify and understand. I document all the stuff that a user might want to modify or understand.

Sometimes I put in say a DEBUG section and withhold some features to keep the users out of trouble. When a weird problem develops, I can explain clearly with simple instructions what to do in order to generate a bug report that I can understand. Or perhaps I put in something like DUMP_DECISION_STACK =0 and can tell the user to set that =1. I often use the INI file during development as debug "level" tool.


In reply to Re^6: Recover a path from a config file by Marshall
in thread Recover a path from a config file by Chaoui05

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.