my $config = Module::New::Config->new( file => 'config.yaml' ); my $value = $config->get('some_key'); $config->set('some_key' => 'value'); $config->load; $config->save;
Used internally to get/set the config value.
takes an optional hash, creates an object, and loads a configuration file if any (or creates one if none is found).
If you pass a key, returns a value for the key. Without a key, returns the whole configuration hash reference.
takes pairs of key/value and update the config (temporarily). If you want to keep the configuration, use
loads a configuration file written in YAML. The file is looked for in the current and home directory by default.
may take a hash to update, and saves the current configuration to a file.
returns the current config file.
takes Getopt::Long's specifications, parses @ARGV, and updates the current configuration.
Kenichi Ishigaki, <ishigaki at cpan.org>
Copyright (C) 2007-2009 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.