Config::Setting::Chunk - Representation of a configuration file
use Config::Setting::Chunk; my $chunk = Config::Setting::Chunk->new; $chunk->add_section( "login" ); $chunk->set_item( "login", "username", "fred" ); my @sections = $chunk->sections; my $username = $chunk->get_item( "login", "username" );
This class is a representation of a configuration file. A chunk consists of zero or more sections, each of which consists of zero or more items.
Class Method. Constructor.
Create a new section named SECTION. Has no effect if SECTION is already present in this chunk.
Return a list of all sections in this chunk, in the order in which they were added.
Returns true or false if SECTION is present or not in this chunk.
Returns a list of all keys present in SECTION.
Set the item KEY to have VALUE in SECTION. if SECTION does not exist, it will be created.
Return the value of KEY in SECTION. Returns undef if KEY or SECTION does not exist.
Return the value of KEY in the first section which contains it, or undef if no section contains it.
Returns the chunk in windows .INI style format. This may be useful for debugging.
Dominic Mitchell, <cpan (at) happygiraffe.net>
Config::Setting.
To install Config::Setting, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Setting
CPAN shell
perl -MCPAN -e shell install Config::Setting
For more information on module installation, please visit the detailed CPAN module installation guide.