> Shaw, Steven wrote: > > Hi I'm trying to use Perl as a configuration language. I have found > > Data::Dumper. I found some doco here: > > > http://tit.irk.ru/perlbookshelf/advprog/ch10_02.htm#ch10-pgfId-976240 > > [snip] > > > > $file = 'configuration.pl'; > > $result = evaluate_file($file); # FIXME > > foreach $item ($result) { > > # process configuration item > > } > > > > A require will probably handle what you want, assuming you > have proper > scoping engaged, or are not 'strict'. Rather than handling this with > Data::Dumper and mangling use/require, you might have a look at the > Storable and Freezethaw modules from CPAN. They perform basically > exactly what you are attempting, but are robust, proven, and > don't have > to be mainained by yourself ;-)....
Thanks. I looked at Storable and Freezethaw (they are also refered to in that doco I was looking at above). Freezethaw wasn't available on my system. Storable used a binary storage format. What I'm looking for is an editable (text) format - just Perl source. This perl source file will define the configuration for the rest of my program. I want users of my program to be able to provide their own configuration file. Using Perl for configuration files saves you the work of writing your own (dodgy) parser. If fact I'm trying to do it this way because I have found multiple errors in the original configuration file parser for my program! >From a fellow INTJ - please understand me. Cheers, Steve. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
