Dear bringers of Perl wisdom,

I am designing a Perl program that uses external configuration files and I thought I better ask here before I fall down the rabbit hole. In the application, the user will be able to specify certain external actions or settings (values in the config file) that are tied to labeled conditions in my program (keys in the config file). The program parses the settings and notes what actions are tied to what condition. This is pretty straightforward if the conditions are all expected to be "true" and "singular", but what if I would like to provide the option to trigger actions when a condition is not true or be able to combine conditions into arbitrary nested sets?

I guess my question boils down to this, should I spend time trying to develop a condition engine that can take any specified nested set of true or false conditions and walk through the corresponding Perl "if", "else", "OR", "AND" , "NOT" , "()" chain or simply require the user to write his/her own modified object that has requirements different from the basic vanilla object?

The first option may be nice for the user if the grammar is close to what we are used to from search engines for instance. However, unless there already exists a module that generates such conditional Perl code on the fly, I suspect I will be spending most of my development time on that feature alone. The second option is far more simple to implement, but basically asks users to write their own plugins.

What are your thoughts on this?


In reply to Specifying multiple conditions in a config file by korpenkraxar

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.