Config::DirectoryOO hash-based interface to directories of files | |
Download |
Config::Directory Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Publisher Name:
- Gavin Carr
- Publisher web site:
- http://search.cpan.org/~gavinc/
Config::Directory Tags
Config::Directory Description
OO hash-based interface to directories of files Config::Directory is a Perl module presents an OO hash-based interface to directories of files. It is particularly suited to configuration directories where settings can cascade across multiple directories with multiple files per directory.Using multiple directories for configuration data allows an application to support, for example, distribution defaults, global site settings, and user-specific local settings, while using files for individual config items makes update interfaces much simpler, does away with lots of parsing problems, and is nicely scriptable.SYNOPSIS use Config::Directory; # Simple $etc = Config::Directory->new("/etc"); $passwd = $etc->get('passwd'); # get() accessor print $etc->{passwd}, "\n"; # hashref accessor # Multiple config directories $cc = Config::Directory->new(); # Options: add prefix, read only first line, ignore all README.* files $qc = Config::Directory->new("/var/qmail/service/qmail/env", { prefix => 'QMAIL_', lines => 1, ignore => 'README.*' }); print $q->{QMAIL_CONCURRENCY}, "\n"; # from file CONCURRENCY # Updating values $qc->set('CONCURRENCY', 10); $etc->set('passwd.min','root:x:0:0:root:/root:/bin/bash'); print $etc->get('passwd.min'), "\n"; Requirements: · Perl
Config::Directory Related Software