line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GnaData::Conform::Hash; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
sub new { |
4
|
1
|
|
|
1
|
0
|
16
|
my $proto = shift; |
5
|
1
|
|
|
|
|
3
|
my $inref = shift; |
6
|
1
|
|
33
|
|
|
8
|
my $class = ref($proto) || $proto; |
7
|
1
|
|
|
|
|
3
|
my $self = {}; |
8
|
1
|
|
|
|
|
4
|
bless ($self, $class); |
9
|
1
|
|
|
|
|
21
|
$self->{'myhash'} = {}; |
10
|
1
|
|
|
|
|
4
|
$self->{'delete_blank'} = 1; |
11
|
1
|
|
|
|
|
5
|
return $self; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub load { |
15
|
3
|
|
|
3
|
0
|
1966
|
my ($self, $inhash) = @_; |
16
|
3
|
|
|
|
|
5
|
my ($field); |
17
|
3
|
|
|
|
|
13
|
foreach $field (keys %$inhash) { |
18
|
4
|
|
|
|
|
21
|
$self->{'myhash'}->{lc($field)} = $inhash->{$field}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub load_reverse { |
23
|
1
|
|
|
1
|
0
|
889
|
my ($self, $inhash) = @_; |
24
|
1
|
|
|
|
|
2
|
my ($field); |
25
|
1
|
|
|
|
|
4
|
foreach $field (keys %$inhash) { |
26
|
1
|
|
|
|
|
3
|
my($result) = lc($inhash->{$field}); |
27
|
1
|
|
|
|
|
7
|
$self->{'myhash'}->{$result} = $field; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub delete_blank { |
32
|
2
|
|
|
2
|
0
|
1202
|
my ($self, $value) = @_; |
33
|
2
|
50
|
|
|
|
7
|
if (defined($value)) { |
34
|
2
|
|
|
|
|
5
|
$self->{'delete_blank'} = $value; |
35
|
|
|
|
|
|
|
} |
36
|
2
|
|
|
|
|
5
|
return $self->{'delete_blank'}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub conform { |
40
|
6
|
|
|
6
|
0
|
60
|
my ($self, $inhash) = @_; |
41
|
6
|
|
|
|
|
9
|
my (%outhash); |
42
|
6
|
|
|
|
|
7
|
foreach $key (keys %{$inhash}) { |
|
6
|
|
|
|
|
19
|
|
43
|
9
|
|
|
|
|
12
|
my ($keyval) = ""; |
44
|
9
|
|
|
|
|
22
|
my ($keylc) = lc ($key); |
45
|
9
|
50
|
|
|
|
53
|
if (!defined ($self->{'myhash'}->{$keylc})) { |
|
|
50
|
|
|
|
|
|
46
|
0
|
|
|
|
|
0
|
$keyval = $key; |
47
|
|
|
|
|
|
|
} elsif ($self->{'myhash'}->{$keylc} ne "") { |
48
|
9
|
|
|
|
|
16
|
$keyval = $self->{'myhash'}->{$keylc}; |
49
|
|
|
|
|
|
|
} else { |
50
|
0
|
|
|
|
|
0
|
$keyval = ""; |
51
|
|
|
|
|
|
|
} |
52
|
9
|
100
|
66
|
|
|
61
|
if ($keyval ne "" |
|
|
|
100
|
|
|
|
|
53
|
|
|
|
|
|
|
&& $inhash->{$key} ne "" |
54
|
|
|
|
|
|
|
|| $self->{'delete_blank'} == 0) { |
55
|
8
|
|
|
|
|
29
|
$outhash{$keyval} = |
56
|
|
|
|
|
|
|
$inhash->{$key}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
6
|
|
|
|
|
16
|
%{$inhash} = %outhash; |
|
6
|
|
|
|
|
29
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
0
|
0
|
|
sub deconform { |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |