NAME
Myco::Config - Myco Configuration Module
SYNOPSIS
# In myco.conf:
foobar => {
FOOBAR_PORT_NUM => 6288,
FOOBAR_HOST => 'localhost'
},
barbaz => {
BARBAZ_USER => 'bazdude',
BARBAZ_PROFILE => { uid => 1999,
gid => 1999, },
},
# In a Myco entity class:
use Myco::Config qw(:foobar);
# In another Myco entity class:
use Myco::Config qw(:barbaz);
# To get all constants:
use Myco::Config qw(:all);
DESCRIPTION
This module reads in a configuration file and sets up a bunch of constants that can be used in Myco. The configuration file consists of Perl code that, when eval
ed by Myco::Config, generates a hash of hash references. Each hash reference is turned into a series of constants, one for each key/value pair. The keys in the main hash are turned into labels under which the constants generated from the hash reference in the keys' values are listed. This makes it very simple to create export tags that can be used in modules to import only the constants associated with a given label.
While no constants are exported by Myco::Config by default, the special all
tag can be used to export all of the constants created from the configuration file:
use Myco::Config qw(:all);
LICENSE AND COPYRIGHT
Copyright (c) 2006 the myco project. All rights reserved. This software is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
David Wheeler <david@wheeler.net>