line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geography::Country::TZ; |
2
|
3
|
|
|
3
|
|
5169
|
use Geography::Country::TZ::Zone; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
786
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
require Exporter; |
5
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
6
|
|
|
|
|
|
|
@EXPORT_OK = qw(areas areas_dmy from_iso); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
3
|
|
|
3
|
|
8
|
eval { require Net::Country; |
|
3
|
|
|
|
|
2465
|
|
10
|
0
|
|
|
|
|
0
|
%country = %Net::Country::country; |
11
|
0
|
|
|
|
|
0
|
@country{keys %country} = map {s/\s*\(.*\)\s*$//; lc($_);} values %country; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
12
|
0
|
|
|
|
|
0
|
%cross = reverse %country; |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
while () { |
17
|
|
|
|
|
|
|
chop; |
18
|
|
|
|
|
|
|
($cn, $geo, $tz) = split(/\s+/); |
19
|
|
|
|
|
|
|
$hash{$cn} ||= []; |
20
|
|
|
|
|
|
|
push(@{$hash{$cn}}, $tz); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub from_iso { |
24
|
1
|
|
|
1
|
0
|
7
|
$cross{lc($_[0])}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub areas { |
28
|
0
|
|
|
0
|
0
|
|
my $cn = uc(shift); |
29
|
0
|
|
0
|
|
|
|
my $areas = $hash{$cn} || $hash{from_iso($cn)}; |
30
|
0
|
0
|
|
|
|
|
return undef unless ($areas); |
31
|
0
|
|
|
|
|
|
my @areas = @$areas; |
32
|
0
|
|
|
|
|
|
sort {$a <=> $b} map {Geography::Country::TZ::Zone::getoffset($_);} |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
@areas; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub areas_dmy { |
37
|
0
|
|
|
0
|
0
|
|
my $cn = uc(shift); |
38
|
0
|
|
0
|
|
|
|
my $areas = $hash{$cn} || $hash{$cross{$cn}}; |
39
|
0
|
0
|
|
|
|
|
return undef unless ($areas); |
40
|
0
|
|
|
|
|
|
my @areas = @$areas; |
41
|
0
|
|
|
|
|
|
sort {$a <=> $b} map {Geography::Country::TZ::Zone::getpastoffset($_, @_);} |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
@areas; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__DATA__ |