Config::Tree::YAMLHashFile - Read configuration tree from a YAML file containing multiple hashes that can be based on one another


Config-Tree documentation  | view source Contained in the Config-Tree distribution.

Index


NAME

Top

Config::Tree::YAMLHashFile - Read configuration tree from a YAML file containing multiple hashes that can be based on one another

SYNOPSIS

Top

 # 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

Top

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

Top

METHODS

Top

set($path, $val)

Not supported at the moment.

unset($path, $val)

Not supported at the moment.

save()

Not supported at the moment.

SEE ALSO

Top

Config::Tree::YAMLHashDir

AUTHOR

Top

Steven Haryanto, <stevenharyanto at gmail.com>

COPYRIGHT & LICENSE

Top


Config-Tree documentation  | view source Contained in the Config-Tree distribution.