This software module allows for the reading of user-friendly configuration files.
The author developed Config::Natural to serve a specific need - the requirement to conveniently supply information to HTML::Template based scripts. To achieve this, Config::Natural's API is compatible with that of HTML::Template, enabling users to write straightforward programs like the one below:
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;
Indeed, this example is not trivial; the author of the module uses similarly uncomplicated scripts to craft the majority of web pages.
In terms of usage, one can use Config::Natural to read files like mail.conf as shown in the example below:
use Config::Natural;
my $mailconf = new Config::Natural 'mail.conf';
Users can extract data from the configuration file like a signature using `$mailconf->param('signature')`.
In summary, Config::Natural is a useful Perl module that simplifies the process of reading configuration files, enabling users to write uncomplicated HTML::Template-based scripts.
Version 1.01: N/A