GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Config::INI::Simple(3) User Contributed Perl Documentation Config::INI::Simple(3)

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

Only dependency is File::Slurp.

--------------- 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");

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.

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.

Torsten Geyer

Config::INI::Reader

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.

2011-10-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.