# Reads "name=value" pairs from conf files. 
#
# how to use
# require "/path.../confReader.pm";
# %X=&readConf("/path.of.your.conf.file.../x.conf");
#
# $myVar=$x{paramName};
# comments start with '#'.  '#' must the first character.
# it cannot be mixed with name=value pairs. it must be on a line
# of its own

sub readConf
{
    my($file)=@_;
    my(@conf);
    open (READ, "$file");
    chomp(@conf=<READ>);
    close (READ);
    my(@pair); my(@temp); my(%conf);
    foreach (@conf) {
	if ($_ !~ /^#/) {
	    @pair=split /=/, $_;
	    push @temp, $pair[0];
	    push @temp, $pair[1];
	}
    }
    @conf=@temp;
    %conf=@conf;
    return %conf;
}

1;
