Config::Objective

Perl module for parsing object-oriented config files
Download

Config::Objective Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Mark D. Roth
  • Publisher web site:
  • http://search.cpan.org/~roth/

Config::Objective Tags


Config::Objective Description

Perl module for parsing object-oriented config files 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:new() 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 ".".object_name 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").get_obj() Returns a reference to the object of the specified object name. The object name is the first argument.obj_names() Returns a list of known object names.get_hash() 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.SYNOPSIS use Config::Objective; use Config::Objective::String; use Config::Objective::List; 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"; Requirements: · Perl


Config::Objective Related Software