Author image Brian Koontz


Config::IniSearch - Wrapper class for Config::IniHash to search for INI files


    use Config::IniSearch;
    $config = new Config::IniSearch( 'inisection' );
    $val = $config->{param_name};

    use Config::IniSearch;
    $config = new Config::IniSearch( 'inisection', ['/usr/local/share/myfile.ini'] );
    $val = $config->{param_name};


This module is intended to relieve the developer from having to keep track of the location and name of individual INI files. An INI file will be recognized by one of two names:


Either/both of these must contain the section [inisection].

The following methods are available:

$config = new Config::IniSearch( $INISectionName, [$INIFileName, %IniHashOpts] );

The constructor requires one argument, a section name, $INISectionName. Optional arguments include a fully-qualified INI filename ($INIFileName) and options for Config::IniHash (see perldoc Config::IniHash). NOTE: By default, case is preserved.

$INIFileName must be set if passing in options for Config::IniHash. The section name does not need to be specified when accessing elements in $INISectionName:

$val = $config->{param_name};

When the constructor is invoked, the following list of defaults is searched for the appropriate INI file:


Notice that the first INI file found will be the one used for subsequent lookups.

$inifile = $config->getINIFilename;

Returns the name of the INI file currently accessed by the object.

$section_name = $config->getSectionName;

Returns the name of the INI section name currently accessed by $config.


None by default.


Brian Koontz <>


Copyright (c) 2003 Brian Koontz <>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 160:

You forgot a '=back' before '=head1'