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

App::SmokeBrew::IniFile - Parse the smokebrew configuration file

VERSION

version 1.06

SYNOPSIS

use App::SmokeBrew::IniFile;

my $cfg = App::SmokeBrew::IniFile->read_file( 'smokebrew.cfg' );

DESCRIPTION

App::SmokeBrew::IniFile is a subclass of Config::INI::Reader which supports multi-valued parameters. Parameters which are specified multiple times will become an arrayref in the resultant hashref structure that is produced.

METHODS

This subclass overrides one of the Config::INI::Reader methods:

set_value

This method is overriden to support multi-valued parameters. If a parameter is specified multiple times the INI file it will become an arrayref.

If 'foo.ini' contains:

  dir=/home/foo
  mirror=http://some.mirror.com/
  mirror=ftp://some.other.mirror.org/CPAN/

my $cfg = App::SmokeBrew::IniFile->read_file( 'foo.ini' );

  $cfg = {
            '_'  => {
                        dir => '/home/foo',

                        mirrors => [
                                      'http://some.mirror.com/',
                                      'ftp://some.other.mirror.org/CPAN/',
                        ],
            },
         }

KUDOS

Thanks to Ricardo Signes for pointing out his awesome module to me.

SEE ALSO

Config::INI::Reader

AUTHOR

Chris Williams <chris@bingosnet.co.uk>

COPYRIGHT AND LICENSE

This software is copyright (c) 2023 by Chris Williams.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.