korpenkraxar has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Specifying multiple conditions in a config file
by stevieb (Canon) on Jan 24, 2012 at 22:15 UTC | |
by planetscape (Chancellor) on Jan 25, 2012 at 13:18 UTC | |
by korpenkraxar (Sexton) on Feb 04, 2012 at 19:19 UTC | |
|
Re: Specifying multiple conditions in a config file
by Anonymous Monk on Jan 24, 2012 at 22:37 UTC | |
|
Re: Specifying multiple conditions in a config file
by TJPride (Pilgrim) on Jan 25, 2012 at 03:46 UTC | |
by korpenkraxar (Sexton) on Feb 04, 2012 at 19:34 UTC |