The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Config::INI::Simple - provides quick access to the contents of .ini files

Only dependency is File::Slurp.

SYNOPSIS

--------------- INI ---------------

test=blah

[section]

section-entry=lol

--------------- Code --------------

#read ini

my $ini = Config::INI::Simple->new("test.ini");

print $ini->{_}->{test}, "\n";

print $ini->{section}->{"section-entry"}, "\n";

#write ini

$ini = Config::INI::Simple->new();

$ini->{section1}->{key1} = "value1";

$ini->{section1}->{key2} = "value2";

$ini->write("test.ini");

DESCRIPTION

Config::INI::Simple parses the .ini file at construction time and returns a hashref to the sections, which themselves are hashrefs to the sections' key value pairs.

the top section, unless named is called "_" like in Config::INI::Reader.

if no path is passed to new(), and empty object is returned which can be used to construct an ini and then write() it to a specific file.

RATIONAL

Config::INI::Reader depends on some uncommon packages, which themselves depend on other uncommon packages. Since my CPAN installer was somehow broken, I ended up installing its dozen of dependencies by hand. After wasting half an hour with manual package handling, i wrote my own little parser instead. This one only uses File::Slurp, which i consider a standard module.

AUTHOR

Torsten Geyer

SEE ALSO

Config::INI::Reader

COPYRIGHT AND LICENSE

Copyright (C) 2011 by Torsten Geyer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl5 itself.