NAME
Config::Properties::Simple - Perl extension to manage properties files.
SYNOPSIS
use Config::Properties::Simple;
my $cfg=Config::Properties::Simple->new();
my $foo=$cfg->getProperty('foo', 'default foo');
$cfg->setProperty(bar => 'my bar')
$cfg->save
ABSTRACT
Wrapper around Config::Properties to simplify its use.
DESCRIPTION
This package mix functionality in Config::Properties and Config::Find packages to provide a simple access to configuration files.
It changes new
and save
methods of Config::Properties (every other method continues to work as usual):
- Config::Properties::Simple->new(%opts)
-
creates a new Config::Properties::Simple object and reads on the configuration file determined by the options passed through
%opts
.The supported ptions are:
defaults => {...}
-
hash reference containing default values for the configuration keys (similar to
defaultProperties
field in the originalConfig::Properties::new
constructor). noread => 1
-
stops properties for being read from a file.
optional => 1
-
by default an exception is thrown when the configuration file can not be find or opened, this option makes the constructor succeed anyway.
If the
file
option is included and defined the constructor dies even withoptional
set. format => $format
-
equivalent to calling
setFormat
method.
In addition, any option accepted by Config::Find is also allowed here.
- $this->save(%opts)
-
creates a new configuration file with the properties defined in the object.
%opts
are passed to Config::Find to determine the configuration file name and location.
EXPORT
None, this package is OO.
SEE ALSO
Config::Properties, Config::Find.
AUTHOR
Salvador Fandiño, <sfandino@yahoo.com>
COPYRIGHT AND LICENSE
Copyright 2003 by Salvador Fandiño
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 150:
Non-ASCII character seen before =encoding in 'Fandiño,'. Assuming CP1252