Config-General reviews

cpanratings
 

RSS | Module Info | Add a review of Config-General

Config-General (2.42) *****

Great module; keep up the good work.

Frank Bicknell - 2011-05-12T13:11:57 (permalink)

0 out of 3 found this review helpful. Was this review helpful to you?  Yes No

Config-General (2.43) ***

C::G has a nice, human-readable/writeable syntax, and is convenient for managing simple configuration.

However... it can become increasingly frustrating for complex scenarios. Because it returns a bare Perl data-structure, options with single values will be returned as hash-references, and options with multiple values as array-refs. This means that in the case that you don't *know* how many options you'll get back, you have to faff about with flattening list refs etc.
(Helpfully, unless you're running 5.10, whenever you get this wrong, you'll get annoying warnings about pseudo-hashes, but the error may occur somewhere random in your code, leading to more debugging fun).

You might think you know how many values to expect, but it's surprisingly easy to make mistakes on this, especially if you overlay multiple configuration files (site and local, for example). Some settings, such as -MergeDuplicateBlocks might help with this; sadly we weren't using it in our project.

Also, C::G is incapable of outputting "named blocks" (e.g. <page foo.html>). Though the documentation claims that this is functionally identical, it can only emit a much uglier <page><foo.html>.

osfameron - 2009-07-31T12:15:09 (permalink)

5 out of 6 found this review helpful. Was this review helpful to you?  Yes No

Config-General (2.37)

RwBerg wrote:

> But there are some missing items in the
> documentation, such as "save_file".

That's wrong. There is a section about save_file() in the docs. Read at search.cpan.org/~tlinden/Config-Gener...

> Also, when saving back to a config file
> the order and formatting is rearranged.
> I know the formatting can be altered, but
> no way or documentation has been found on
> how to do so.

No. There's an option "-Tie" which can be supplied to new(). It takes a Tie class name as argument. The docs are explaining it:

"You could, for example supply a tied hash, say Tie::DxHash, which preserves ordering of the keys in the config."

So, just read the docs. Try "perldoc Config::General".

tlinden - 2007-11-24T17:36:10 (permalink)

3 out of 3 found this review helpful. Was this review helpful to you?  Yes No

Config-General (2.33) ****

This is a very good concept and I love to use it. But there are some missing items in the documentation, such as "save_file". Also, when saving back to a config file the order and formatting is rearranged. I know the formatting can be altered, but no way or documentation has been found on how to do so.

Just trying to help. Aside from that, it's really an amazing piece of Perl. Way to go!

RwBerg - 2007-08-07T11:41:45 (permalink)

4 out of 4 found this review helpful. Was this review helpful to you?  Yes No

Config-General (2.21) ****

Easy to implement and a whole slew of features and options. The configuration files for programs using this module are in an apache style, so no more smb.conf madness. (:

Best feature i like is the ability to load a config, munge it and save it again.

deliria - 2003-09-18T04:55:26 (permalink)

4 out of 4 found this review helpful. Was this review helpful to you?  Yes No

Config-General (2.21) ****

An excellent module for creating "apache-like" configuration. Every program using Perl should use this for his configuration file.

alexandre dulaunoy - 2003-08-19T04:29:47 (permalink)

4 out of 4 found this review helpful. Was this review helpful to you?  Yes No
3 hidden unhelpful reviews