Crane::Config - Configuration manager
use Crane::Config; my $filename = config->{'log'}->{'filename'};
Configuration manager which operates with YAML configurations. Settings are available as a hash reference returned by config function.
You can specify default configuration and filename by passing it to config function when first call (see description below).
Returns link to current configuration.
At first call you can specify default configuration $config and/or list of config file names @filenames.
Merge two configs ($config to $original).
Reads confugration from file named $filename.
Saves configuration $config to file named $filename.
Load configurations from files named @filenames and merges them to configuration $config and default configuration.
Where %s is file name and %s is error message.
Invalid YAML configuration file.
Fires when unable to open configuration for read.
Fires when unable to open configuration for write.
Fires when function required hash reference as a configuration.
Fires when function required name of file but it is undefined.
Configuration file
domain: "production" log: level: 0 filename: "/var/log/example/messages.log" error_filename: "/var/log/example/errors.log" servers: - "127.0.0.1:3001" - "127.0.0.1:3002"
Which results to hash reference:
{ 'domain' => 'production', 'log' => { 'level' => '0', 'filename' => '/var/log/example/messages.log', 'error_filename' => '/var/log/example/errors.log', }, 'servers' => [ '127.0.0.1:3001', '127.0.0.1:3002', ], }
See Crane::Base.
Default configuration file (may not exist).
Please report any bugs or feature requests to https://rt.cpan.org/Public/Bug/Report.html?Queue=Crane or to https://github.com/temoon/crane/issues.
Tema Novikov, <novikov.tema@gmail.com>
Copyright (C) 2013-2014 Tema Novikov.
This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license in the file LICENSE.
RT Cpan
https://rt.cpan.org/Public/Dist/Display.html?Name=Crane
Github
https://github.com/temoon/crane
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Crane, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crane
CPAN shell
perl -MCPAN -e shell install Crane
For more information on module installation, please visit the detailed CPAN module installation guide.