OTRS::OPM::Analyzer::Utils::Config - class to parse a yaml config
version 0.07
use OTRS::OPM::Analyzer::Utils::Config; my $config = '/path/to/config.yml'; my $obj = OTRS::OPM::Analyzer::Utils::Config->new( $config ); print $obj->get( 'app.path' ); # /opt/otrs/ print $obj->get( 'app' )->{path}; # /opt/otrs/ $obj->set( 'app.version', '3.3.3' ); print $obj->get( 'app.version' ); # 3.3.3
config.yml
--- app: path: /opt/otrs/
Creates a new object of the config parser
use OTRS::OPM::Analyzer::Utils::Config; my $config = '/path/to/config.yml'; my $obj = OTRS::OPM::Analyzer::Utils::Config->new( $config );
Loads a new config
my $config = '/path/to/config.yml'; my $obj = OTRS::OPM::Analyzer::Utils::Config->new; $obj->load( $config );
Returns the value of a given config key. Multilevel hashes can be separated with a '.'
print $obj->get( 'app.path' ); # /opt/otrs/ print $obj->get( 'app' )->{path}; # /opt/otrs/
Sets a config option
$obj->set( 'app.version', '3.3.3' );
Renee Baecker <reneeb@cpan.org>
This software is Copyright (c) 2014 by Renee Baecker.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install OTRS::OPM::Analyzer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OTRS::OPM::Analyzer
CPAN shell
perl -MCPAN -e shell install OTRS::OPM::Analyzer
For more information on module installation, please visit the detailed CPAN module installation guide.