Module::New::Config - Module::New::Config documentation


Module-New documentation  | view source Contained in the Module-New distribution.

Index


NAME

Top

Module::New::Config

SYNOPSIS

Top

  my $config = Module::New::Config->new( file => 'config.yaml' );

  my $value  = $config->get('some_key');
  $config->set('some_key' => 'value');

  $config->load;
  $config->save;

DESCRIPTION

Top

Used internally to get/set the config value.

METHODS

Top

new

takes an optional hash, creates an object, and loads a configuration file if any (or creates one if none is found).

get

If you pass a key, returns a value for the key. Without a key, returns the whole configuration hash reference.

set

takes pairs of key/value and update the config (temporarily). If you want to keep the configuration, use save instead.

load

loads a configuration file written in YAML. The file is looked for in the current and home directory by default.

save

may take a hash to update, and saves the current configuration to a file.

file

returns the current config file.

get_options

takes Getopt::Long's specifications, parses @ARGV, and updates the current configuration.

AUTHOR

Top

Kenichi Ishigaki, <ishigaki at cpan.org>

COPYRIGHT AND LICENSE

Top


Module-New documentation  | view source Contained in the Module-New distribution.