NAME

App::Netsync::Configurator - configuration file support

DESCRIPTION

This package makes using a configuration file simple.

SYNOPSIS

foobar.ini
[testGroup]
fooSetting = barValue
barSetting = bazValue
bazSetting = foo,bar,baz
foobar.pl
#!/usr/bin/env perl

use feature 'say';

use App::Netsync::Configurator;

configurate 'foobar.ini';
say  App::Netsync::Configurator::config('testGroup','fooSetting');
say (App::Netsync::Configurator::config('testGroup','bazSetting'))[2];
say {App::Netsync::Configurator::config('testGroup')}->{'barSetting'};
$ perl foobar.pl
> barValue
> baz
> bazValue

METHODS

configurate

reads a configuration file into the App::Netsync::Configurator namespace

Note: It will return any configurations in the file found under the <script name> group.

Arguments

[ ( $file [, \%overrides [, \%defaults ] ] ) ]

file

a configuration file (.ini) to use

default: /etc/<script name>/<script name>.ini

overrides

settings that should override the configuration

defaults

default settings

config

returns an individual setting or group of settings

Note: configurate needs to be run first!

Arguments

( $group [, $query ] )

group

the group of the configuration(s) to retrieve

query

the name of the configuration to retrieve

dump

prints the current configuration (use sparingly)

Note: configurate needs to be run first!

AUTHOR

David Tucker, <dmtucker at ucsc.edu>

BUGS

Please report any bugs or feature requests to bug-netsync at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-Netsync. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc App::Netsync

You can also look for information at:

LICENSE

Copyright 2013 David Tucker.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.