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
|
|
1151
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
217
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
59
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
53
|
|
24
|
2
|
|
|
2
|
|
34
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174404; |
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} = {"5161", "Ucayali", |
127
|
|
|
|
|
|
|
"5142", "San\ Martín", |
128
|
|
|
|
|
|
|
"5151", "Puno", |
129
|
|
|
|
|
|
|
"5167", "Huancavelica", |
130
|
|
|
|
|
|
|
"5144", "La\ Libertad", |
131
|
|
|
|
|
|
|
"5143", "Ancash", |
132
|
|
|
|
|
|
|
"5165", "Loreto", |
133
|
|
|
|
|
|
|
"5154", "Arequipa", |
134
|
|
|
|
|
|
|
"5172", "Tumbes", |
135
|
|
|
|
|
|
|
"5141", "Amazonas", |
136
|
|
|
|
|
|
|
"5162", "Huánuco", |
137
|
|
|
|
|
|
|
"5183", "Apurímac", |
138
|
|
|
|
|
|
|
"5164", "Junín", |
139
|
|
|
|
|
|
|
"5174", "Lambayeque", |
140
|
|
|
|
|
|
|
"5152", "Tacna", |
141
|
|
|
|
|
|
|
"5156", "Ica", |
142
|
|
|
|
|
|
|
"5163", "Pasco", |
143
|
|
|
|
|
|
|
"5184", "Cusco", |
144
|
|
|
|
|
|
|
"5173", "Piura", |
145
|
|
|
|
|
|
|
"5153", "Moquegua", |
146
|
|
|
|
|
|
|
"5166", "Ayacucho", |
147
|
|
|
|
|
|
|
"511", "Lima\/Callao", |
148
|
|
|
|
|
|
|
"5182", "Madre\ de\ Dios", |
149
|
|
|
|
|
|
|
"5176", "Cajamarca",}; |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub new { |
152
|
19
|
|
|
19
|
1
|
36
|
my $class = shift; |
153
|
19
|
|
|
|
|
36
|
my $number = shift; |
154
|
19
|
|
|
|
|
120
|
$number =~ s/(^\+51|\D)//g; |
155
|
19
|
|
|
|
|
120
|
my $self = bless({ country_code => '51', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
156
|
19
|
100
|
|
|
|
94
|
return $self if ($self->is_valid()); |
157
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
158
|
1
|
|
|
|
|
10
|
$self = bless({ country_code => '51', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
159
|
1
|
50
|
|
|
|
3
|
return $self->is_valid() ? $self : undef; |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
1; |