Config::Objective is a Perl module that provides a mechanism for parsing config files to manipulate configuration data. Unlike most other config file modules, which represent config data as simple variables, Config::Objective represents config data as perl objects. This allows for a much more flexible configuration language, since new classes can be easily written to add methods to the config syntax.
The Config::Objective class supports the following methods:
The constructor. The first argument is the filename of the config file to parse. The second argument is a reference to a hash that maps names to configuration objects.
The remaining arguments are interpretted as a hash of attributes for the object. Currently, the only supported attribute is include_dir, which specifies the directory to search for include files (see "File Inclusion"). If not specified, include_dir defaults to ".".
Once the constructor parses the config file, you can call the get() method of any of the objects by using the object name as an autoloaded method (see "Recommended Methods").
Returns a reference to the object of the specified object name. The object name is the first argument.
Returns a list of known object names.
Returns a hash where the keys are the known object names and the values are the result of calling the get() method on the corresponding object.
my $conf = Config::Objective->new('filename',
'var1' => Config::Objective::String->new(),
'var2' => Config::Objective::List->new(),
'include_dir' => '/usr/local/share/appname');
print "var1 = \"" . $conf->var1 . "\"\n";