line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Number::Phone::UK::Data; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
6035410
|
use warnings; |
|
17
|
|
|
|
|
70
|
|
|
17
|
|
|
|
|
744
|
|
4
|
17
|
|
|
17
|
|
125
|
use strict; |
|
17
|
|
|
|
|
75
|
|
|
17
|
|
|
|
|
451
|
|
5
|
|
|
|
|
|
|
|
6
|
17
|
|
|
17
|
|
122
|
use Number::Phone; |
|
17
|
|
|
|
|
55
|
|
|
17
|
|
|
|
|
195
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = "2.0001"; |
9
|
|
|
|
|
|
|
|
10
|
17
|
|
|
17
|
|
806
|
use DBM::Deep; |
|
17
|
|
|
|
|
164038
|
|
|
17
|
|
|
|
|
140
|
|
11
|
17
|
|
|
17
|
|
672
|
use File::ShareDir; |
|
17
|
|
|
|
|
80
|
|
|
17
|
|
|
|
|
4540
|
|
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
|
9810
|
100
|
|
9810
|
0
|
79198
|
return $db if($slurped); |
21
|
6751
|
100
|
100
|
|
|
15396
|
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
|
|
|
|
|
184
|
$pid = $$; |
25
|
18
|
50
|
|
|
|
1281
|
open(my $ro_fh, '<:bytes', $file) || die(__PACKAGE__.": can't open $file: $!\n"); |
26
|
18
|
|
|
|
|
254
|
$db = DBM::Deep->new(fh => $ro_fh); |
27
|
|
|
|
|
|
|
} |
28
|
6751
|
|
|
|
|
566148
|
return $db |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub slurp { |
32
|
4
|
100
|
|
4
|
0
|
4018882
|
return if($slurped); |
33
|
3
|
|
|
|
|
47
|
$db = _slurp(db()); |
34
|
3
|
|
|
|
|
278
|
$slurped++; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _slurp { |
38
|
1995249
|
|
|
1995249
|
|
5938840
|
my $db = shift; |
39
|
1995249
|
100
|
|
|
|
2844685288
|
if(!ref($db)) { |
40
|
1991526
|
|
|
|
|
13105079
|
return $db |
41
|
|
|
|
|
|
|
} else { |
42
|
|
|
|
|
|
|
return { map { |
43
|
1995246
|
|
|
|
|
2094940344
|
$_ => _slurp($db->{$_}) |
44
|
3723
|
|
|
|
|
6445
|
} keys(%{$db}) }; |
|
3723
|
|
|
|
|
16565
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |