forked from Nextomics/pipeline-for-isoseq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Soft.pm
32 lines (31 loc) · 879 Bytes
/
Soft.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package Soft;
use strict;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(parse_config);
##parse the software.config file, and check the existence of each software
################################################
sub parse_config{
my ($config,$soft)=@_;
open IN,$config || die;
my %ha;
while(<IN>){
chomp;
next if /^#|^$/;
s/\s+//g;
my @p=split/=/,$_;
$ha{$p[0]}=$p[1];
}
close IN;
if(exists $ha{$soft}){
if(-e $ha{$soft}){
return $ha{$soft};
}else{
die "\nConfig Error: $soft wrong path in $config\n";
}
}else{
die "\nConfig Error: $soft not set in $config\n";
}
}
1;
__END__