NAME

Config::Mini - Very simple INI-style configuration parser

SYNOPSIS

In your config file:

foo = bar
baz = buz

[section1]
key1 = val1
key2 = val2

[section2]
key3 = val3
key4 = arrayvalue
key4 = arrayvalue2
key4 = arrayvalue3

In your perl code:

use Config::Mini; Config::Mini::parse_file ('sample.cfg');

my $foo = Config::Mini::get ("general", "foo"); my @key4 = Config::Mini::get ("section2", "key4");

SUMMARY

Config::Mini is a very simple INI style parser.

FUNCTIONS

Config::Mini::parse_file ($filename)

Parses config file $filename

Config::Mini::parse_data (@data)

Parses @data

Config::Mini::get ($context, $key)

Returns the value for $key in $context.

Returns the value as an array if the requested value is an array.

Return the first value otherwise.

Config::Mini::instantiate ($context)

If $context is used to describe an object, Config::Mini will try to instantiate it.

If $section contains a "package" attribute, Config::Mini will try to load that package and call a new() method to instantiate the object.

Otherwise, it will simply return a hash reference.

Values can be considered as a scalar or an array. Hence, Config::Mini uses <attribute_name> for scalar values and '__<attribute_name>' for array values.

Config::Mini::select ($regex)

Selects all section entries matching $regex, and returns a list of instantiated objects using instantiate() for each of them.

AUTHOR

Copyright 2006 - Jean-Michel Hiver All rights reserved

This module is free software and is distributed under the same license as Perl itself. Use it at your own risk.