App::SmokeBrew::IniFile - Parse the smokebrew configuration file
version 1.04
use App::SmokeBrew::IniFile; my $cfg = App::SmokeBrew::IniFile->read_file( 'smokebrew.cfg' );
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.
arrayref
hashref
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/', ], }, }
Thanks to Ricardo Signes for pointing out his awesome module to me.
Config::INI::Reader
Chris Williams <chris@bingosnet.co.uk>
This software is copyright (c) 2022 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.
To install smokebrew, copy and paste the appropriate command in to your terminal.
cpanm
cpanm smokebrew
CPAN shell
perl -MCPAN -e shell install smokebrew
For more information on module installation, please visit the detailed CPAN module installation guide.