line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Number::Phone::UK::Data; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
6034434
|
use warnings; |
|
17
|
|
|
|
|
82
|
|
|
17
|
|
|
|
|
738
|
|
4
|
17
|
|
|
17
|
|
107
|
use strict; |
|
17
|
|
|
|
|
51
|
|
|
17
|
|
|
|
|
555
|
|
5
|
|
|
|
|
|
|
|
6
|
17
|
|
|
17
|
|
142
|
use Number::Phone; |
|
17
|
|
|
|
|
52
|
|
|
17
|
|
|
|
|
192
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = "2.0002"; |
9
|
|
|
|
|
|
|
|
10
|
17
|
|
|
17
|
|
778
|
use Data::CompactReadonly; |
|
17
|
|
|
|
|
566565
|
|
|
17
|
|
|
|
|
741
|
|
11
|
17
|
|
|
17
|
|
180
|
use File::ShareDir; |
|
17
|
|
|
|
|
73
|
|
|
17
|
|
|
|
|
4396
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $file = Number::Phone::_find_data_file('Number-Phone-UK-Data.db'); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $slurped = 0; |
16
|
|
|
|
|
|
|
my $db; |
17
|
|
|
|
|
|
|
my $pid = -1; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub db { |
20
|
9619
|
100
|
|
9619
|
0
|
734314
|
return $db if($slurped); |
21
|
6620
|
100
|
100
|
|
|
25985
|
if(!$db || $pid != $$) { |
22
|
|
|
|
|
|
|
# we want to re-open the DB if we've forked, because of |
23
|
|
|
|
|
|
|
# https://github.com/DrHyde/perl-modules-Number-Phone/issues/72 |
24
|
18
|
|
|
|
|
97
|
$pid = $$; |
25
|
18
|
|
|
|
|
177
|
$db = Data::CompactReadonly->read($file, tie => 1, fast_collections => 1); |
26
|
|
|
|
|
|
|
} |
27
|
6620
|
|
|
|
|
126512
|
return $db |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub slurp { |
31
|
4
|
100
|
|
4
|
0
|
4450623
|
return if($slurped); |
32
|
3
|
|
|
|
|
115
|
$db = _slurp(db()); |
33
|
3
|
|
|
|
|
4823659
|
$slurped++; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _slurp { |
37
|
2972910
|
|
|
2972910
|
|
9242663
|
my $db = shift; |
38
|
2972910
|
100
|
|
|
|
1576979292
|
if(!ref($db)) { |
39
|
2972865
|
|
|
|
|
19174207
|
return $db |
40
|
|
|
|
|
|
|
} else { |
41
|
|
|
|
|
|
|
return { map { |
42
|
2972907
|
|
|
|
|
1043535258
|
$_ => _slurp($db->{$_}) |
43
|
45
|
|
|
|
|
178
|
} keys(%{$db}) }; |
|
45
|
|
|
|
|
463
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |