in reply to easy config file

Hi,

Back in my younger and less wise days of Perling, I wrote an application that ran on many different instances of data and depended upon a configuration file to know how to act for each instance of the data. I started out with something much like you have demonstrated above, but with requested features and necessary additions I found a need to represent arrays, hashes and compound data structures in my now very complex configuration file.

These configuration files continue to grow in size and complexity to this day to they point where they can be 20k+ in size and I have an 18 page document describing how to configure it. Not only that, but it is very easy to break and if you do so the entire application stops working (for that instance of the data). (eval catches it, but the data is needed to run, so it just stops.)

I bring this up in such detail because I did what I thought at the time to be a wise action and kick myself on a daily basis for my actions now. I hope you are not setting yourself up for the same situation that I find myself in today. I face a monumental task of rewriting a large application and re-educating many users.

If today I was starting over again with my current knowledge I would implement the entire application based on configuration files written in XML. The XML::Simple module excels at performing such tasks. The added advantage is that such files are very eye-ball friendly. So I entreat you to consider this module or some other alternative our wonderful fellow monks can provide.

Best of luck,
{NULE}

-- http://www.nule.org

Update:
Thanks for the information, merlyn. I will be sure to eval{use Data::Denter} for my own application. I may be inclined towards XML just because it is so cross-platform, cross-language, etc.

Replies are listed 'Best First'.
Re: Re: easy config file
by merlyn (Sage) on Oct 05, 2001 at 19:08 UTC