NAME

Labrador::Common::Config

SYNOPSIS

	use Labrador::Common::Config;
	my $config = new Labrador::Common::Config(filename => '../data/etc/labrador.cfg');
	my $port = $config->get_scalar('DispatcherPort');
	my $urlalloc = $config->get_scalar('URLAlloc', 1) || 'Delay';

DESCRIPTION

Loads config file from file or a string. The string options means that the configuration file can be transferred across the network from the dispatcher.

METHODS

new(%options)

%options = filename => $filename OR text => \@text

get_scalar($name, $optional)

Get the value of the directive named $name in the config file. Return undef if $optional is set and the parameter isn't found.

get_array($name, $optional)

Get all values of named $name in the config file. Return undef if $optional is set and and the parameter isn't found.

get_file_text()

Returns a reference to (or an array of all lines) of the text of the config file, with all comments and blank lines omitted.

set_default

Set a default for a parameter if it isn't in the configuration file that was parsed. Most cases should use the get_ directives with $optional set. This method is provided for if a higher module wants to override a default.

REVISION

	$Revision: 1.8 $