The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Chronicle::Config::Reader - Simple configuration file reader.

SYNOPSIS

      use strict;
      use warnings;

      use Chronicle::Config::Reader;

      my %config;

      my $helper = Chronicle::Config::Reader->new();
      $helper->parseFile( \%config, "/etc/foo.rc" );

DESCRIPTION

This module is contains the code required to read a chronicle configuration file. The configuration files it reads are simple files consisting of lines which are of the form "key=value".

Additional features include:

Comment Handling

Comments are begun with the # character and continue to the end of the line.

Comments may occur at the start, middle, or end of a line.

Environmental variable expansion

Environmental variables are expanded if they are detected.

Command-execution and expansion

If backticks are found in configuration values they will be replaced with the output of the specified command.

The following snippet demonstrates these features:

    # The path variable will be set to /bin:/sbin:...
    path = $PATH

    # Our hostname will be set
    hostname = `hostname`

AUTHOR

Steve Kemp <steve@steve.org.uk>

COPYRIGHT AND LICENSE

Copyright (C) 2014 Steve Kemp <steve@steve.org.uk>.

This library is free software. You can modify and or distribute it under the same terms as Perl itself.