my %configParamHash = ();
open ( _FH, $configFileName ) or die "Unable to open config file: $!";
while ( <_FH> ) {
chomp;
s/#.*//; # ignore comments
s/^\s+//; # trim leading spaces if any
s/\s+$//; # trim leading spaces if any
next unless length;
my ($_configParam, $_paramValue) = split(/\s*=\s*/, $_, 2);
$configParamHash{$_configParam} = $_paramValue;
}
close _FH;
Now %configParamHash will contain the key-value pair of the config values.