Config::Constants::Perl - Configuration loader for Config::Constants


Config-Constants documentation  | view source Contained in the Config-Constants distribution.

Index


NAME

Top

Config::Constants::Perl - Configuration loader for Config::Constants

SYNOPSIS

Top

  use Config::Constants::Perl;

DESCRIPTION

Top

This module reads and evaluates perl files as configuration files. This is a highly unsafe option unless your configuration files are secure since we use the do function to read the file. You should take great caution in using this module/feature. For a safer option, consider Config::Constants::XML.

That said, your perl data structures should look like this:

  {
      'Foo::Bar' => {
          'BAZ' => 'the coolest module ever',
      }
  }  

The main structure is a hash, each key being your module name, their values being an Array of Hashes. Those hashes each having exactly one key-value pair. The key is the name of the constant (which should be a valid perl identifier), and the value should be the constant value you want.

METHODS

Top

new ($file)

This takes the file, loads it and stores the resulting hash.

modules

This will return an array of modules in this configuration.

constants ($module_name)

Given a $module_name, this will return an array of hash references for each constant specified.

TO DO

Top

Consider making this safer using Safe.pm?

BUGS

Top

None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.

CODE COVERAGE

Top

I use Devel::Cover to test the code coverage of my tests, see the Config::Constants module for more information.

AUTHOR

Top

stevan little, <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Top


Config-Constants documentation  | view source Contained in the Config-Constants distribution.