in reply to RFC: Config::File

Two comments:

1 -- Seems like a wrapper to Data::Dumper with file loading built in (and required) with the addition of handling for non-existant values. Personally, I'll stick with Data::Dumper and just write to a file when needed, or I would use something like YAML -- which does a very similar thing (LoadFile) and is cross-platform.

2 -- Why not use Data::Dumper internally to increase code reuse?

Replies are listed 'Best First'.
Re: Re: RFC: Config::File
by fireartist (Chaplain) on Feb 10, 2004 at 20:30 UTC

    I'm not really sure, but I'm wondering if you're looking at this backwards.
    This module only allows for loading a configuration file, not saving. Providing a filename is therefore always required.
    Data::Dumper wouldn't provide any code-reuse, as all the parsing is done by perl's own do function.
    I also like my code-editor providing syntax checking for the config file, unlike if the file were a YAML format.

    However, I hadn't really looked at YAML before and from what I've just seen, it does look interesting. - I'll remember it's there in the future.
    Thanks for your feedback.

      This module only allows for loading a configuration file, not saving. Providing a filename is therefore always required.
      Consider that RFE #1. It should support saving. A config file class that only allows for loading is missing a rather important feature if you want the config file to be manipulated by software (such as a GUI or web interface or command line) rather than by text editors. You won't see many config modules in other languages neglect to implement a save feature. It's just not done. CPAN has a few holes in that sort of logic here and there, mainly because it's community supported -- that's ok -- but I'd rather see the signal to noise ratio improved by including core features where applicable.