You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

functions.pl

# 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;

  • No labels