NAME
MToken::Config - MToken global and local configuration
VERSION
Version 1.01
SYNOPSIS
use MToken::Config;
my $config = new MToken::Config(
global_file => '/foo/bar/global.conf',
local_file => '/foo/bar/local.conf',
name => 'foo', # Optional
);
my $foo = $config->get('foo');
my $foo = $config->set('foo' => 'bar');
my $status = $config->save(); # Local file only
DESCRIPTION
The module works with the configuration data
METHODS
- new
-
my $config = new WWW::MLite::Config( global_file => '/foo/bar/global.conf', local_file => '/foo/bar/local.conf', name => 'foo', # Optional );
Returns configuration object
- get
-
my $value = $config->get( 'key' );
Returns value by keyname
- getall, conf, config
-
my %config = $config->getall;
Returns all allowed pairs - key and value
- set
-
$config->set( 'key', $value );
Set new value for key. Returns status of the operation
- save
-
$config->save;
Save current configuration to local_file and returns status of the operation
HISTORY
See Changes
file
AUTHOR
Serż Minus (Sergey Lepenkov) http://www.serzik.com <abalama@cpan.org>
COPYRIGHT
Copyright (C) 1998-2019 D&D Corporation. All Rights Reserved
LICENSE
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/