CTK::Configuration - Configuration of CTK
Version 1.00
use CTK::Configuration; my $config = new CTK::Configuration( config => "foo.conf", confdir => "conf", options => {... Config::General options ...}, );
The module works with the configuration
my $config = new CTK::Configuration( config => "/path/to/config/file.conf", confdir => "/path/to/config/directory", options => {... Config::General options ...}, );
Example foo.conf file:
Foo 1 Bar test Flag true
Example of the "conf" structure of $config object:
print Dumper($config->{conf}); $VAR1 = { 'foo' => 1 'bar' => 'test', 'flag' => 1, }
Specifies absolute or relative path to config-file.
Specifies absolute or relative path to config-dir.
Options of Config::General
my $error = $config->error;
Returns error string if occurred any errors while creating the object or reading the configuration file
my $value = $config->conf( 'key' );
Gets value from config structure by key
my $config_hash = $config->conf;
Returns config hash structure
my $value = $config->get( 'key' );
my $config_hash = $config->getall;
$config->set( 'key', 'value' );
Sets value to config structure by key. Returns setted value
print $config->error unless $config->status;
Returns boolean status of loading config file
Init version
See Changes file
Changes
Config::General, Try::Tiny
See TODO file
TODO
* none noted
Config::General
Serż Minus (Sergey Lepenkov) http://www.serzik.com <abalama@cpan.org>
Copyright (C) 1998-2019 D&D Corporation. All Rights Reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See LICENSE file and https://dev.perl.org/licenses/
LICENSE
To install CTK, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CTK
CPAN shell
perl -MCPAN -e shell install CTK
For more information on module installation, please visit the detailed CPAN module installation guide.