NAME
Config::Tree::YAMLHashFile - Read configuration tree from a YAML file containing multiple hashes that can be based on one another
SYNOPSIS
# in config.yaml:
server: {services: {http: No, ftp: No, dns_resolver: Yes, dns_server: No, mysql: No}}
dns_server: [server, {services: {dns_server: Yes}}]
powerdns_server: [dns_server, {services: {mysql: Yes}}]
dns1: [powerdns_server, {ip: 1.2.3.4}]
dns2: [dns_server, {ip: 1.2.3.5}]
# in script.pl:
use Config::Tree::YAMLHashFile;
my $conf = Config::Tree::YAMLHashFile->new(
path => '/path/to/config.yaml',
# see Config::Tree::File for other options
);
$conf->get('/dns2/ip'); # 1.2.3.5
$conf->get('/dns2/services/mysql'); # 0
$conf->get('/dns1/services/mysql'); # 1
DESCRIPTION
CT::YAMLHashFile has the same idea as Config::Tree::YAMLHashDir, except that all hashes are stored in a top-level structure in single file.
ATTRIBUTES
METHODS
set($path, $val)
Not supported at the moment.
unset($path, $val)
Not supported at the moment.
save()
Not supported at the moment.
SEE ALSO
AUTHOR
Steven Haryanto, <stevenharyanto at gmail.com>
COPYRIGHT & LICENSE
Copyright 2009 Steven Haryanto, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.