line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lang::HL::Export; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
105218
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
5
|
no warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
1291
|
use utf8; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
6
|
|
6
|
1
|
|
|
1
|
|
39
|
use feature qw(signatures); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
133
|
|
7
|
1
|
|
|
1
|
|
7
|
no warnings "experimental::signatures"; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
82
|
|
8
|
1
|
|
|
1
|
|
7
|
no warnings "experimental::smartmatch"; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
9
|
1
|
|
|
1
|
|
537
|
use Hash::Merge; |
|
1
|
|
|
|
|
12429
|
|
|
1
|
|
|
|
|
1100
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require Exporter; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.16'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
16
|
|
|
|
|
|
|
our @EXPORT = qw( |
17
|
|
|
|
|
|
|
arrayLength |
18
|
|
|
|
|
|
|
arrayMerge |
19
|
|
|
|
|
|
|
arraySort |
20
|
|
|
|
|
|
|
arrayPop |
21
|
|
|
|
|
|
|
arrayPush |
22
|
|
|
|
|
|
|
arrayShift |
23
|
|
|
|
|
|
|
arrayUnshift |
24
|
|
|
|
|
|
|
arraySort |
25
|
|
|
|
|
|
|
arrayJoin |
26
|
|
|
|
|
|
|
arrayReverse |
27
|
|
|
|
|
|
|
arrayDelete |
28
|
|
|
|
|
|
|
hashKeys |
29
|
|
|
|
|
|
|
hashElement |
30
|
|
|
|
|
|
|
hashMerge |
31
|
|
|
|
|
|
|
hashDelete |
32
|
|
|
|
|
|
|
stringConcat |
33
|
|
|
|
|
|
|
stringSplit |
34
|
|
|
|
|
|
|
stringLength |
35
|
|
|
|
|
|
|
stringPart |
36
|
|
|
|
|
|
|
stringLast |
37
|
|
|
|
|
|
|
readFile |
38
|
|
|
|
|
|
|
writeFile |
39
|
|
|
|
|
|
|
randomNumber |
40
|
|
|
|
|
|
|
makeInt |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
0
|
|
sub arrayDelete($array, $element) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
delete($array->[$element]); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
0
|
0
|
|
sub hashDelete($hash, $element) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
delete($hash->{$element}); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
0
|
0
|
|
sub arrayReverse($array) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my @reversedArray = reverse(@{$array}); |
|
0
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
return \@reversedArray; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
0
|
0
|
|
sub arrayJoin($separator, $array) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
my @array = @{$array}; |
|
0
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
return join($separator, $array); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
0
|
0
|
|
sub arraySort($array) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
my @array = @{$array}; |
|
0
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my @sortedArray = sort(@array); |
65
|
0
|
|
|
|
|
|
return \@sortedArray; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
0
|
0
|
|
sub arrayUnshift($array, $element) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
unshift(@{$array}, $element); |
|
0
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
0
|
0
|
|
sub arrayShift($array) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
return shift(@{$array}); |
|
0
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
0
|
0
|
|
sub arrayPush($array, $element) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
push(@{$array}, $element); |
|
0
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
0
|
0
|
|
sub arrayPop($array) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
return pop(@{$array}); |
|
0
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
0
|
0
|
|
sub makeInt($number) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
return int $number; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
0
|
0
|
|
sub randomNumber($number) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
return rand($number); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
0
|
0
|
|
sub stringConcat($textOne, $textTwo) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
return $textOne . $textTwo; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
0
|
0
|
|
sub stringSplit($separator, $text) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
my @split = split($separator, $text); |
98
|
0
|
|
|
|
|
|
return \@split; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
0
|
0
|
|
sub stringLength($text) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
return length($text); |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
0
|
0
|
|
sub stringPart($text, $from, $to) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
return substr($text, $from, $to); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
0
|
|
|
0
|
0
|
|
sub stringLast($text) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
return substr($text, -1); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
0
|
|
|
0
|
0
|
|
sub arrayLength($array) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
my @newArray = @{$array}; |
|
0
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
return $#newArray; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
0
|
0
|
|
sub arrayMerge($arrayOne, $arrayTwo) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
|
my @newArray = ( @{$arrayOne}, @{$arrayTwo} ); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
120
|
0
|
|
|
|
|
|
return \@newArray; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
0
|
|
|
0
|
0
|
|
sub hashElement($hash, $element) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
124
|
0
|
|
|
|
|
|
my %hashMap = %{$hash}; |
|
0
|
|
|
|
|
|
|
125
|
0
|
0
|
|
|
|
|
if( exists $hashMap{$element} ) { |
126
|
0
|
|
|
|
|
|
return 1; |
127
|
|
|
|
|
|
|
} else { |
128
|
0
|
|
|
|
|
|
return 0; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
0
|
|
|
0
|
0
|
|
sub hashKeys($hash) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
133
|
0
|
|
|
|
|
|
my @keys = keys(%{$hash}); |
|
0
|
|
|
|
|
|
|
134
|
0
|
|
|
|
|
|
return \@keys; |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
0
|
|
|
0
|
0
|
|
sub hashMerge($hashOne, $hashTwo) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
138
|
0
|
|
|
|
|
|
my $mergedHash = merge($hashOne, $hashTwo); |
139
|
0
|
|
|
|
|
|
return $mergedHash; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
0
|
|
|
0
|
0
|
|
sub readFile($fileName) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
|
my $fileContent; |
144
|
0
|
0
|
|
|
|
|
open(my $fh, '<:encoding(UTF-8)', $fileName) or die "Cannot open the $fileName file"; |
145
|
|
|
|
|
|
|
{ |
146
|
0
|
|
|
|
|
|
local $/; |
|
0
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
|
$fileContent = <$fh>; |
148
|
|
|
|
|
|
|
} |
149
|
0
|
|
|
|
|
|
close($fh); |
150
|
0
|
|
|
|
|
|
return $fileContent; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
0
|
|
|
0
|
0
|
|
sub writeFile($fileName, $fileContent) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
154
|
0
|
0
|
|
|
|
|
open(my $fh, '>:encoding(UTF-8)', $fileName) or die "Cannot open the $fileName file"; |
155
|
0
|
|
|
|
|
|
print $fh $fileContent; |
156
|
0
|
|
|
|
|
|
close($fh); |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
1; |
160
|
|
|
|
|
|
|
__END__ |