line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 David Cantrell, derived from data from libphonenumber |
6
|
|
|
|
|
|
|
# http://code.google.com/p/libphonenumber/ |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
9
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
10
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
15
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
16
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
18
|
|
|
|
|
|
|
# limitations under the License. |
19
|
|
|
|
|
|
|
package Number::Phone::StubCountry::PE; |
20
|
2
|
|
|
2
|
|
1197
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
230
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
34
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
47
|
|
23
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
57
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
14
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => '80', |
31
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{5})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2', |
36
|
|
|
|
|
|
|
'leading_digits' => '1', |
37
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
38
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{7})' |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
'format' => '$1 $2', |
42
|
|
|
|
|
|
|
'leading_digits' => '[4-8]', |
43
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
44
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{6})' |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
48
|
|
|
|
|
|
|
'leading_digits' => '9', |
49
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3})' |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
]; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $validators = { |
54
|
|
|
|
|
|
|
'fixed_line' => ' |
55
|
|
|
|
|
|
|
(?: |
56
|
|
|
|
|
|
|
(?: |
57
|
|
|
|
|
|
|
4[34]| |
58
|
|
|
|
|
|
|
5[14] |
59
|
|
|
|
|
|
|
)[0-8]\\d| |
60
|
|
|
|
|
|
|
7(?: |
61
|
|
|
|
|
|
|
173| |
62
|
|
|
|
|
|
|
3[0-8]\\d |
63
|
|
|
|
|
|
|
)| |
64
|
|
|
|
|
|
|
8(?: |
65
|
|
|
|
|
|
|
10[05689]| |
66
|
|
|
|
|
|
|
6(?: |
67
|
|
|
|
|
|
|
0[06-9]| |
68
|
|
|
|
|
|
|
1[6-9]| |
69
|
|
|
|
|
|
|
29 |
70
|
|
|
|
|
|
|
)| |
71
|
|
|
|
|
|
|
7(?: |
72
|
|
|
|
|
|
|
0[569]| |
73
|
|
|
|
|
|
|
[56]0 |
74
|
|
|
|
|
|
|
) |
75
|
|
|
|
|
|
|
) |
76
|
|
|
|
|
|
|
)\\d{4}| |
77
|
|
|
|
|
|
|
(?: |
78
|
|
|
|
|
|
|
1[0-8]| |
79
|
|
|
|
|
|
|
4[12]| |
80
|
|
|
|
|
|
|
5[236]| |
81
|
|
|
|
|
|
|
6[1-7]| |
82
|
|
|
|
|
|
|
7[246]| |
83
|
|
|
|
|
|
|
8[2-4] |
84
|
|
|
|
|
|
|
)\\d{6} |
85
|
|
|
|
|
|
|
', |
86
|
|
|
|
|
|
|
'geographic' => ' |
87
|
|
|
|
|
|
|
(?: |
88
|
|
|
|
|
|
|
(?: |
89
|
|
|
|
|
|
|
4[34]| |
90
|
|
|
|
|
|
|
5[14] |
91
|
|
|
|
|
|
|
)[0-8]\\d| |
92
|
|
|
|
|
|
|
7(?: |
93
|
|
|
|
|
|
|
173| |
94
|
|
|
|
|
|
|
3[0-8]\\d |
95
|
|
|
|
|
|
|
)| |
96
|
|
|
|
|
|
|
8(?: |
97
|
|
|
|
|
|
|
10[05689]| |
98
|
|
|
|
|
|
|
6(?: |
99
|
|
|
|
|
|
|
0[06-9]| |
100
|
|
|
|
|
|
|
1[6-9]| |
101
|
|
|
|
|
|
|
29 |
102
|
|
|
|
|
|
|
)| |
103
|
|
|
|
|
|
|
7(?: |
104
|
|
|
|
|
|
|
0[569]| |
105
|
|
|
|
|
|
|
[56]0 |
106
|
|
|
|
|
|
|
) |
107
|
|
|
|
|
|
|
) |
108
|
|
|
|
|
|
|
)\\d{4}| |
109
|
|
|
|
|
|
|
(?: |
110
|
|
|
|
|
|
|
1[0-8]| |
111
|
|
|
|
|
|
|
4[12]| |
112
|
|
|
|
|
|
|
5[236]| |
113
|
|
|
|
|
|
|
6[1-7]| |
114
|
|
|
|
|
|
|
7[246]| |
115
|
|
|
|
|
|
|
8[2-4] |
116
|
|
|
|
|
|
|
)\\d{6} |
117
|
|
|
|
|
|
|
', |
118
|
|
|
|
|
|
|
'mobile' => '9\\d{8}', |
119
|
|
|
|
|
|
|
'pager' => '', |
120
|
|
|
|
|
|
|
'personal_number' => '80[24]\\d{5}', |
121
|
|
|
|
|
|
|
'specialrate' => '(801\\d{5})|(805\\d{5})', |
122
|
|
|
|
|
|
|
'toll_free' => '800\\d{5}', |
123
|
|
|
|
|
|
|
'voip' => '' |
124
|
|
|
|
|
|
|
}; |
125
|
|
|
|
|
|
|
my %areanames = (); |
126
|
|
|
|
|
|
|
$areanames{en} = {"5144", "La\ Libertad", |
127
|
|
|
|
|
|
|
"5142", "San\ Martín", |
128
|
|
|
|
|
|
|
"5151", "Puno", |
129
|
|
|
|
|
|
|
"5163", "Pasco", |
130
|
|
|
|
|
|
|
"5176", "Cajamarca", |
131
|
|
|
|
|
|
|
"5183", "Apurímac", |
132
|
|
|
|
|
|
|
"511", "Lima\/Callao", |
133
|
|
|
|
|
|
|
"5141", "Amazonas", |
134
|
|
|
|
|
|
|
"5173", "Piura", |
135
|
|
|
|
|
|
|
"5166", "Ayacucho", |
136
|
|
|
|
|
|
|
"5154", "Arequipa", |
137
|
|
|
|
|
|
|
"5152", "Tacna", |
138
|
|
|
|
|
|
|
"5165", "Loreto", |
139
|
|
|
|
|
|
|
"5143", "Ancash", |
140
|
|
|
|
|
|
|
"5164", "Junín", |
141
|
|
|
|
|
|
|
"5156", "Ica", |
142
|
|
|
|
|
|
|
"5167", "Huancavelica", |
143
|
|
|
|
|
|
|
"5162", "Huánuco", |
144
|
|
|
|
|
|
|
"5182", "Madre\ de\ Dios", |
145
|
|
|
|
|
|
|
"5184", "Cusco", |
146
|
|
|
|
|
|
|
"5172", "Tumbes", |
147
|
|
|
|
|
|
|
"5174", "Lambayeque", |
148
|
|
|
|
|
|
|
"5153", "Moquegua", |
149
|
|
|
|
|
|
|
"5161", "Ucayali",}; |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub new { |
152
|
19
|
|
|
19
|
1
|
43
|
my $class = shift; |
153
|
19
|
|
|
|
|
36
|
my $number = shift; |
154
|
19
|
|
|
|
|
127
|
$number =~ s/(^\+51|\D)//g; |
155
|
19
|
|
|
|
|
114
|
my $self = bless({ country_code => '51', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
156
|
19
|
100
|
|
|
|
99
|
return $self if ($self->is_valid()); |
157
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
158
|
1
|
|
|
|
|
15
|
$self = bless({ country_code => '51', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
159
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
1; |