Author image Nigel Wetters Gourlay


Db::Mediasurface::ReadConfig - reads, parses, and stores configuration from a Mediasurface file.


This document refers to version 0.01 of DB::Mediasurface::ReadConfig, released August 3, 2001.


    use Db::Mediasurface::ReadConfig;

my $path = '/opt/ms/3.0.2/etc/';

my $config = Db::Mediasurface::ReadConfig->new( path=>$path );

print('oracle user is '.$config->get_username."\n");



When supplied with a path to a Mediasurface configuration file (usually called, this module loads the configuration details into an object, which can be interrogated at a later time.


$config = Db::Mediasurface::ReadConfig->new( path=>$path );

This class method constructs a new configuration object by reading the file at location $path. This module assumes that the configuration file is constructed in the following manner...

Each key/value pair occurs on a single line, and the key and value are separated by an equals sign (=) and (optionally) white space. Any text on a line is ignored which follows a hash symbol (#).


$value = $config->get_SOME_CONFIG_KEY;

Returns the value associated with a particular configuration key. If the key contained a full-stop in the config file, this is replaced by an underscore. For example, to get the value associated with jdbc.driver in the config file, use $config->get_jdbc_driver


Sets the value of a given key. Does not write the value back to the config file - no permanent damage is done ;)


Nigel Wetters (


Copyright (c) 2001, Nigel Wetters. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.