line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CN::Province; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
22368
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
283
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw(abbr2province province2abbr all_province all_abbr); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my %abbr_province = ( |
15
|
|
|
|
|
|
|
'AH' => '安徽', |
16
|
|
|
|
|
|
|
'LN' => '辽宁', |
17
|
|
|
|
|
|
|
'BJ' => '北京', |
18
|
|
|
|
|
|
|
'NM' => '内蒙古', |
19
|
|
|
|
|
|
|
'FJ' => '福建', |
20
|
|
|
|
|
|
|
'NX' => '宁夏', |
21
|
|
|
|
|
|
|
'GD' => '广东', |
22
|
|
|
|
|
|
|
'QH' => '青海', |
23
|
|
|
|
|
|
|
'GS' => '甘肃', |
24
|
|
|
|
|
|
|
'SC' => '四川', |
25
|
|
|
|
|
|
|
'GX' => '广西', |
26
|
|
|
|
|
|
|
'SD' => '山东', |
27
|
|
|
|
|
|
|
'GZ' => '贵州', |
28
|
|
|
|
|
|
|
'SH' => '上海', |
29
|
|
|
|
|
|
|
'HB' => '湖北', |
30
|
|
|
|
|
|
|
'SN' => '陕西', |
31
|
|
|
|
|
|
|
'HEB'=> '河北', |
32
|
|
|
|
|
|
|
'SX' => '山西', |
33
|
|
|
|
|
|
|
'HEN'=> '河南', |
34
|
|
|
|
|
|
|
'TJ' => '天津', |
35
|
|
|
|
|
|
|
'HI' => '海南', |
36
|
|
|
|
|
|
|
'TW' => '台湾', |
37
|
|
|
|
|
|
|
'HL' => '黑龙江', |
38
|
|
|
|
|
|
|
'XJ' => '新疆', |
39
|
|
|
|
|
|
|
'HN' => '湖南', |
40
|
|
|
|
|
|
|
'XZ' => '西藏', |
41
|
|
|
|
|
|
|
'JL' => '吉林', |
42
|
|
|
|
|
|
|
'YN' => '云南', |
43
|
|
|
|
|
|
|
'JS' => '江苏', |
44
|
|
|
|
|
|
|
'ZJ' => '浙江', |
45
|
|
|
|
|
|
|
'JX' => '江西', |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my %province_abbr = map({$abbr_province{uc $_} => $_} keys %abbr_province); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub abbr2province { |
51
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
52
|
0
|
0
|
|
|
|
|
my $abbr = shift or die "must have the abbreviation of province argument"; |
53
|
0
|
|
|
|
|
|
return $abbr_province{uc($abbr)}; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub province2abbr { |
57
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
58
|
0
|
0
|
|
|
|
|
my $state = shift or die "must have the name of province argument"; |
59
|
0
|
|
|
|
|
|
return $province_abbr{$state}; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub all_province { |
63
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
64
|
0
|
|
|
|
|
|
sort keys %province_abbr; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub all_abbr { |
68
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
69
|
0
|
|
|
|
|
|
sort keys %abbr_province; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
__DATA__ |