Config::Natural

Module that can read easy-to-use configuration files
Download

Config::Natural Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Sebastien Aperghis-Tramoni
  • Publisher web site:
  • http://search.cpan.org/~saper/

Config::Natural Tags


Config::Natural Description

Module that can read easy-to-use configuration files Config::Natural is a Perl module that has been written in order to provide an easy way to read simple configuration files. The syntax of these configuration files is what seemed to me the most natural way to write these files, hence the name of this module.One of the reason I wrote this module is that I wanted a very easy way to feed data to HTML::Template based scripts. Therefore the API of Config::Natural is compatible with HTML::Template, and you can write programs as simple as: use strict; use Config::Natural; use HTML::Template; my $source = new Config::Natural 'file.src'; my $tmpl = new HTML::Template type => 'filename', source => 'file.tmpl', associate => $source; print $tmpl->output;And this is not just another trivial example: I use scripts nearly as simple as this one to create most of my web pages.SYNOPSISLets say you have a file mail.conf name = John Doe email = jdoe@somewhere.net server = mail.somewhere.net signature = -John Doe--Visit my homepage at http://www.somewhere.net/~jdoe/.You can read it using the following program: use Config::Natural; my $mailconf = new Config::Natural 'mail.conf';and you can for example print the signature: print $mailconf->param('signature'); Requirements: · Perl


Config::Natural Related Software