The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MToken::Config - MToken global and local configuration

VERSION

Version 1.00

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

Sergey Lepenkov (Serz Minus) http://www.serzik.com <abalama@cpan.org>

COPYRIGHT

Copyright (C) 1998-2017 D&D Corporation. All Rights Reserved

LICENSE

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See LICENSE file