Toader::Config - Represents the Toader config.
Version 0.0.1
This initiates the object.
my $foo = Toader::Config->new; if ( $foo->error ){ warn('error:'.$foo->error.': '.$foo->errorString); }
This returns the Config::Tiny object storing the Toader config.
There is no need to do any error checking as long as Toader new suceeded with out issue.
my $config=$foo->getConfig;
This returns a list of sections.
my @sections=$foo->listSections;
This returns a list of variables for a section.
my @variables=$foo->listVariables( $section ); if ( $foo->error ){ warn( 'error:'.$foo->error.': '.$foo->errorString ); }
This deletes a specified value.
Two arguments are taken. The first is the section. If not specified, "_" is used. The second and required one is the variable name.
As long as the section exists, which it always will for '_', and a variable name is specified, this won't error.
$foo->valueDel( $section, $variable );
This returns a value that has been set for a variable.
If a value does not exist, undef is returned.
my $value=$foo->valueGet( $section, $variable );
This sets a new value for the config.
Third arguments are taken. The first is the section. If not specified, "_" is used. The second and required one is the variable name. The third and required is the the value.
If the specified section does not exist, a new one will be created.
Neither the section or variable name can match /[\t \n\=\#\;]/.
my $value=$foo->valueSet( $section, $variable, $value );
Writes the config out to the Toader config file.
$foo->write; if ( $foo->error ){ warn('error:'.$foo->error.': '.$foo->errorString); }
No Toader object specified.
The specified object is not a Toader object.
The Toader object did not return a directory.
Failed to read the config file.
The section does not exist.
No variable name specified.
Variable or section matched /[\t \n\=\#\;]/.
Failed to write the config out.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-toader at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Toader. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-toader at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Toader::Config
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Toader
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Toader
CPAN Ratings
http://cpanratings.perl.org/d/Toader
Search CPAN
http://search.cpan.org/dist/Toader/
Copyright 2011 Zane C. Bowers-Hadley.
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.
To install Toader, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Toader
CPAN shell
perl -MCPAN -e shell install Toader
For more information on module installation, please visit the detailed CPAN module installation guide.