Perl Config::General setup and usage

Few libraries have been as useful to me over the years as Perl’s Config::General.

It gives us a simple way to create configurable scripts with minimal code, in a syntax-light configuration file format. The configuration file format is similar to apache’s, and the module can parse native apache configuration files.

How to start using it:

use Config::General;

my $conf = new Config::General("some_config.conf");
my %config = $conf->getall;

my $property = $config{some_property};

For this example, the configuration file could be as simple as:

some_property    "value"
    http_host             ""
    http_port             8080
    http_timeout          30

For documentation and further details, check