perl-Config-Properties-Simple-0.14-alt1.noarch.rpm


Advertisement

Description

perl-Config-Properties-Simple - Perl extension to manage configuration files

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package name perl-Config-Properties-Simple
Package version 0.14
Package release alt1
Package architecture noarch
Package type rpm
Installed size 13.36 KB
Download size 13.36 KB
Official Mirror ftp.altlinux.org
This package mix functionality in the Config::Properties manpage and.the Config::Find manpage packages to provide a simple access to
configuration files.
It changes `new' and `save' methods of the Config::Properties manpage (every
other method continues to work as usual):
=over 4
=item Config::Properties::Simple->new(%opts)
creates a new the Config::Properties::Simple manpage object and reads on the
configuration file determined by the options passed through `%opts'.
The supported options are:
=over 4
=item `defaults => {...}'
hash reference containing default values for the configuration keys
(similar to `defaultProperties' field in the original
`Config::Properties::new' constructor).
=item `noread => 1'
=item `mode => "write"'
stops properties for being read from a file.
=item `utf8 ='> 1>
opens the file for reading/writing with the `:utf8' layer.
=item `optional => 1'
by default an exception is thrown when the configuration file can not
be found or opened, this option makes the constructor succeed anyway.
If the `file' option is included and defined the constructor dies
unless `optional' value is greater than 1. This is useful to let the
user pass the configuration file name on the script command line when
you want the script to fail if it's not found.
=item `format => $format'
equivalent to calling `setFormat' method.
=item `dups_ok => 1'
by default, an error is reported when two similar keys are found on
the same file, setting dups_ok causes previous values to be ignored
instead.
=item `aliases => { alias1 =' key1, alias2 =>key2 ... }
entries on the configuration file whose keys are found on the aliases
hash are normalized to the corresponding key. Aliases only affect
parsing and are not taken into account for default values or when
getting or setting properties.
=item `validate => ...'
sets conditions that the properties in the configuration file have to
meet.
There are several formats allowed:
=over 4
=item `validate => \&subroutine'
calls the subroutine as
&subroutine($key, $value, $cfg)
subroutine should return a true value if the pair `$key' `$value' is
valid or false otherwise. For customized error messages
`$cfg->fail($error)' can be called.
Both `$key' and `$value' can be modified manipulating the `@_'
array directly. Its sometimes useful to normalize the value, i.e.:
use Date::Manip;
sub validate_date { defined($_[1] = Date::Manip::ParseDate($_[1])) }
my $cfg = Config::Properties::Simple->new(validate => \&validate_date);
=item `validate => \@array'
only properties in `@array' are allowed. Regexp are also allowed
inside de array. i.e.:
validate => [ qr/^Foo\.\w+$/, qw(Bar Doz) ],
=item `validate => \%hash'
`%hash' allows to set a condition for every property.
There could be an additional `__default' entry to be applied to
properties that don't have their own entries.
Supported conditions are:
=over 4
=item `\&subroutine'
calls the subroutine as
&subroutine($key, $value, $cfg)
similar to passing a validating subrutine (explained before).
=item `\@array'
property value has to be in `@array'.
=item `\%hash'
`$hash{$value}' has to exist and its value is returned instead of the
original `$value'.
=item `qr/regular expression/'
`$value' has to match the regular expression.
=item `b' or `boolean'
`$value' has to be a boolean value.
Valid true values are `y', `yes', `t', `true', `1'.
Valid false values are `n', `no', `f', `false', `0', .
Case doesn't matter.
=item `u' or `unsigned'
unsigned integer.
=item `i' or `integer'
integer
=item `f', `float', `n' or `number'
float number
=item `s', `string', `a' or `any'
anything is ok.
=back
=back
=item `required => [...]'
properties that have to be included in the configuration file. When
someone is missing, an exception is raised telling the user the
reason.
=back
Any option accepted by the Config::Find manpage can also be used in `new'
method.
=item $this->save(%opts)
creates a new configuration file with the properties defined in the
object.
`%opts' are passed to `Config::Find->find()' to determine the
configuration file name and location.
=item $this->fail($error)
method to be called from inside validation subs to report an error. It
appends the filename and the line number to the error and throws an
exception that if uncatched will show the user what went wrong.
=back

Alternatives

Package Version Architecture Repository
perl-Config-Properties-Simple - - -

Requires

Name Value
/usr/share/perl5 -
perl(Config/Find.pm) >= 0.180
perl(Config/Properties.pm) >= 0.590
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(Config/Properties/Simple.pm) = 0.140
perl-Config-Properties-Simple = 0.14-alt1

Download

Type URL
Binary Package perl-Config-Properties-Simple-0.14-alt1.noarch.rpm
Source Package perl-Config-Properties-Simple-0.14-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Config-Properties-Simple rpm package:
    # sudo apt-get install perl-Config-Properties-Simple

Files

Path
/usr/share/doc/perl-Config-Properties-Simple-0.14/Changes
/usr/share/doc/perl-Config-Properties-Simple-0.14/README
/usr/share/perl5/Config/
/usr/share/perl5/Config/Properties/Simple.pm

See Also

Package Description
perl-Config-ReadAndCheck-0.04-alt1.noarch.rpm Perl module for parsing generic config files
perl-Config-Record-1.1.2-alt1_28.noarch.rpm Perl module for Configuration file access
perl-Config-Reload-0.21-alt1.noarch.rpm Load config files, reload when files changed
perl-Config-Role-0.1.1-alt1.noarch.rpm Moose config attribute loaded from file in home dir
perl-Config-SL-0.01-alt1.noarch.rpm Configuration abstraction for SL libraries
perl-Config-Savelogs-0.11-alt1.noarch.rpm perl module Config-Savelogs
perl-Config-Scoped-0.22-alt1.noarch.rpm feature rich configuration file parser
perl-Config-Secure-0.0.1-alt1.noarch.rpm Perl extension for scripts run with PSC
perl-Config-Setting-0.04-alt1.noarch.rpm Perl extension for configuration files
perl-Config-Settings-0.02-alt1.noarch.rpm Parsing pleasant configuration files
perl-Config-Simple-Conf-2.003-alt1.noarch.rpm A fast and lightweight configuration file handler
perl-Config-Simple-Extended-0.16-alt1.noarch.rpm Extend Config::Simple w/ Configuration Inheritance, chosen by URL
perl-Config-Simple-Inherit-0.04-alt1.noarch.rpm Inherit values from, overwrite a base configuration
perl-Config-Singleton-0.005-alt1.noarch.rpm one place for your app's configuration
perl-Config-Source-0.08-alt1.noarch.rpm manage a configuration from multiple sources
Advertisement
Advertisement