Myco::Config - Myco Configuration Module
$Revision: 1.3 $
$Date: 2003/12/19 21:52:01 $
# In myco.conf: randy => { RANDY_PORT => 6288, RANDY_HOST => 'localhost' }, apache => { APACHE_USER => 'nobody', APACHE_GROUP => 'nobody' } # In a Myco class: use Myco::Config qw(:randy); # In another Myco class: use Myco::Config qw(:apache); # To get all constants: use Myco::Config qw(:all);
This module reads in a configuration file and sets up a bunch of constants that can be useed in Myco. The configuration file consists of Perl code that, when evaled 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. They 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.
eval
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:
all
use Myco::Config qw(:all);
Copyright (c) 2004 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.
David Wheeler <david@wheeler.net>
Myco::UI::Cache
To install Myco, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Myco
CPAN shell
perl -MCPAN -e shell install Myco
For more information on module installation, please visit the detailed CPAN module installation guide.