# General-purpose functions called by other scripts
# Return a hash of config parameters from the file QC.cfg
# in the format
#
# PARAMETER=value
#
#
sub read_config_params()
{
my $bindir = dirname(abs_path($0)) . "/";
my $cfgfile = $bindir . "QC.cfg";
my %cfgparams;
my $incfg;
open($incfg,$cfgfile) or die "Cannot open $cfgfile\n";
while($line=<$incfg>)
{
chomp $line;
($key,$value) = split "=",$line;
$cfgparams{$key} = $value;
}
close $incfg;
return %cfgparams;
}
1;
|