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::CL; |
20
|
2
|
|
|
2
|
|
1174
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
229
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
45
|
|
23
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
15
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181417; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1', |
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
31
|
|
|
|
|
|
|
'leading_digits' => ' |
32
|
|
|
|
|
|
|
1(?: |
33
|
|
|
|
|
|
|
[03-589]| |
34
|
|
|
|
|
|
|
21 |
35
|
|
|
|
|
|
|
)| |
36
|
|
|
|
|
|
|
[29]0| |
37
|
|
|
|
|
|
|
78 |
38
|
|
|
|
|
|
|
', |
39
|
|
|
|
|
|
|
'pattern' => '(\\d{4})' |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
{ |
42
|
|
|
|
|
|
|
'format' => '$1 $2', |
43
|
|
|
|
|
|
|
'leading_digits' => '2196', |
44
|
|
|
|
|
|
|
'national_rule' => '($1)', |
45
|
|
|
|
|
|
|
'pattern' => '(\\d{5})(\\d{4})' |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
49
|
|
|
|
|
|
|
'leading_digits' => '44', |
50
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
{ |
53
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
54
|
|
|
|
|
|
|
'leading_digits' => '2[1-36]', |
55
|
|
|
|
|
|
|
'national_rule' => '($1)', |
56
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{4})(\\d{4})' |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
60
|
|
|
|
|
|
|
'leading_digits' => '9[2-9]', |
61
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{4})(\\d{4})' |
62
|
|
|
|
|
|
|
}, |
63
|
|
|
|
|
|
|
{ |
64
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
65
|
|
|
|
|
|
|
'leading_digits' => ' |
66
|
|
|
|
|
|
|
3[2-5]| |
67
|
|
|
|
|
|
|
[47]| |
68
|
|
|
|
|
|
|
5[1-3578]| |
69
|
|
|
|
|
|
|
6[13-57]| |
70
|
|
|
|
|
|
|
8(?: |
71
|
|
|
|
|
|
|
0[1-9]| |
72
|
|
|
|
|
|
|
[1-9] |
73
|
|
|
|
|
|
|
) |
74
|
|
|
|
|
|
|
', |
75
|
|
|
|
|
|
|
'national_rule' => '($1)', |
76
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
77
|
|
|
|
|
|
|
}, |
78
|
|
|
|
|
|
|
{ |
79
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
80
|
|
|
|
|
|
|
'leading_digits' => ' |
81
|
|
|
|
|
|
|
60| |
82
|
|
|
|
|
|
|
8 |
83
|
|
|
|
|
|
|
', |
84
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})' |
85
|
|
|
|
|
|
|
}, |
86
|
|
|
|
|
|
|
{ |
87
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
88
|
|
|
|
|
|
|
'leading_digits' => '1', |
89
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})(\\d{4})' |
90
|
|
|
|
|
|
|
}, |
91
|
|
|
|
|
|
|
{ |
92
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
93
|
|
|
|
|
|
|
'leading_digits' => '60', |
94
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{3})' |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
]; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
my $validators = { |
99
|
|
|
|
|
|
|
'geographic' => ' |
100
|
|
|
|
|
|
|
2(?: |
101
|
|
|
|
|
|
|
1982[0-6]| |
102
|
|
|
|
|
|
|
3314[05-9] |
103
|
|
|
|
|
|
|
)\\d{3}| |
104
|
|
|
|
|
|
|
(?: |
105
|
|
|
|
|
|
|
2(?: |
106
|
|
|
|
|
|
|
1(?: |
107
|
|
|
|
|
|
|
160| |
108
|
|
|
|
|
|
|
962 |
109
|
|
|
|
|
|
|
)| |
110
|
|
|
|
|
|
|
3(?: |
111
|
|
|
|
|
|
|
2\\d\\d| |
112
|
|
|
|
|
|
|
3(?: |
113
|
|
|
|
|
|
|
[0346]\\d| |
114
|
|
|
|
|
|
|
1[0-35-9]| |
115
|
|
|
|
|
|
|
2[1-9]| |
116
|
|
|
|
|
|
|
5[0-24-9]| |
117
|
|
|
|
|
|
|
7[0-3] |
118
|
|
|
|
|
|
|
)| |
119
|
|
|
|
|
|
|
600 |
120
|
|
|
|
|
|
|
)| |
121
|
|
|
|
|
|
|
646[59] |
122
|
|
|
|
|
|
|
)| |
123
|
|
|
|
|
|
|
80[1-9]\\d\\d| |
124
|
|
|
|
|
|
|
9(?: |
125
|
|
|
|
|
|
|
3(?: |
126
|
|
|
|
|
|
|
[0-57-9]\\d\\d| |
127
|
|
|
|
|
|
|
6(?: |
128
|
|
|
|
|
|
|
0[02-9]| |
129
|
|
|
|
|
|
|
[1-9]\\d |
130
|
|
|
|
|
|
|
) |
131
|
|
|
|
|
|
|
)| |
132
|
|
|
|
|
|
|
6(?: |
133
|
|
|
|
|
|
|
[0-8]\\d\\d| |
134
|
|
|
|
|
|
|
9(?: |
135
|
|
|
|
|
|
|
[02-79]\\d| |
136
|
|
|
|
|
|
|
1[05-9] |
137
|
|
|
|
|
|
|
) |
138
|
|
|
|
|
|
|
)| |
139
|
|
|
|
|
|
|
7[1-9]\\d\\d| |
140
|
|
|
|
|
|
|
9(?: |
141
|
|
|
|
|
|
|
[03-9]\\d\\d| |
142
|
|
|
|
|
|
|
1(?: |
143
|
|
|
|
|
|
|
[0235-9]\\d| |
144
|
|
|
|
|
|
|
4[0-24-9] |
145
|
|
|
|
|
|
|
)| |
146
|
|
|
|
|
|
|
2(?: |
147
|
|
|
|
|
|
|
[0-79]\\d| |
148
|
|
|
|
|
|
|
8[0-46-9] |
149
|
|
|
|
|
|
|
) |
150
|
|
|
|
|
|
|
) |
151
|
|
|
|
|
|
|
) |
152
|
|
|
|
|
|
|
)\\d{4}| |
153
|
|
|
|
|
|
|
(?: |
154
|
|
|
|
|
|
|
22| |
155
|
|
|
|
|
|
|
3[2-5]| |
156
|
|
|
|
|
|
|
[47][1-35]| |
157
|
|
|
|
|
|
|
5[1-3578]| |
158
|
|
|
|
|
|
|
6[13-57]| |
159
|
|
|
|
|
|
|
8[1-9]| |
160
|
|
|
|
|
|
|
9[2458] |
161
|
|
|
|
|
|
|
)\\d{7} |
162
|
|
|
|
|
|
|
', |
163
|
|
|
|
|
|
|
'pager' => '', |
164
|
|
|
|
|
|
|
'personal_number' => '', |
165
|
|
|
|
|
|
|
'specialrate' => '(600\\d{7,8})', |
166
|
|
|
|
|
|
|
'toll_free' => ' |
167
|
|
|
|
|
|
|
(?: |
168
|
|
|
|
|
|
|
123| |
169
|
|
|
|
|
|
|
8 |
170
|
|
|
|
|
|
|
)00\\d{6} |
171
|
|
|
|
|
|
|
', |
172
|
|
|
|
|
|
|
'voip' => '44\\d{7}' |
173
|
|
|
|
|
|
|
}; |
174
|
|
|
|
|
|
|
my %areanames = (); |
175
|
|
|
|
|
|
|
$areanames{en} = {"5651", "La\ Serena\,\ Coquimbo", |
176
|
|
|
|
|
|
|
"5675", "Curicó\,\ Maule", |
177
|
|
|
|
|
|
|
"5653243", "Ovalle\,\ Coquimbo", |
178
|
|
|
|
|
|
|
"5641", "Concepción\,\ Biobío", |
179
|
|
|
|
|
|
|
"56537", "Ovalle\,\ Coquimbo", |
180
|
|
|
|
|
|
|
"5633", "Quillota\,\ Valparaíso", |
181
|
|
|
|
|
|
|
"5626", "Santiago\,\ Metropolitan\ Region", |
182
|
|
|
|
|
|
|
"5667", "Coyhaique\,\ Aisén", |
183
|
|
|
|
|
|
|
"5653248", "Ovalle\,\ Coquimbo", |
184
|
|
|
|
|
|
|
"56532456", "Ovalle\,\ Coquimbo", |
185
|
|
|
|
|
|
|
"5653247", "Ovalle\,\ Coquimbo", |
186
|
|
|
|
|
|
|
"565328", "Ovalle\,\ Coquimbo", |
187
|
|
|
|
|
|
|
"565322", "Ovalle\,\ Coquimbo", |
188
|
|
|
|
|
|
|
"565327", "Ovalle\,\ Coquimbo", |
189
|
|
|
|
|
|
|
"56534", "Ovalle\,\ Coquimbo", |
190
|
|
|
|
|
|
|
"565325", "Ovalle\,\ Coquimbo", |
191
|
|
|
|
|
|
|
"562198", "Santiago\,\ Metropolitan\ Region", |
192
|
|
|
|
|
|
|
"5652", "Copiapó\,\ Atacama", |
193
|
|
|
|
|
|
|
"5661", "Punta\ Arenas\,\ Magallanes\ and\ Antártica\ Chilena", |
194
|
|
|
|
|
|
|
"56539", "Ovalle\,\ Coquimbo", |
195
|
|
|
|
|
|
|
"5623", "Santiago\,\ Metropolitan\ Region", |
196
|
|
|
|
|
|
|
"56532457", "Ovalle\,\ Coquimbo", |
197
|
|
|
|
|
|
|
"5635", "San\ Antonio\,\ Valparaíso", |
198
|
|
|
|
|
|
|
"5657", "Iquique\,\ Tarapacá", |
199
|
|
|
|
|
|
|
"5664", "Osorno\,\ Los\ Lagos", |
200
|
|
|
|
|
|
|
"56532454", "Ovalle\,\ Coquimbo", |
201
|
|
|
|
|
|
|
"5673", "Linares\,\ Maule", |
202
|
|
|
|
|
|
|
"565329", "Ovalle\,\ Coquimbo", |
203
|
|
|
|
|
|
|
"5642", "Chillán\,\ Biobío", |
204
|
|
|
|
|
|
|
"56536", "Ovalle\,\ Coquimbo", |
205
|
|
|
|
|
|
|
"5645", "Temuco\,\ Araucanía", |
206
|
|
|
|
|
|
|
"56532453", "Ovalle\,\ Coquimbo", |
207
|
|
|
|
|
|
|
"56538", "Ovalle\,\ Coquimbo", |
208
|
|
|
|
|
|
|
"5671", "Talca\,\ Maule", |
209
|
|
|
|
|
|
|
"56535", "Ovalle\,\ Coquimbo", |
210
|
|
|
|
|
|
|
"56532452", "Ovalle\,\ Coquimbo", |
211
|
|
|
|
|
|
|
"56531", "Ovalle\,\ Coquimbo", |
212
|
|
|
|
|
|
|
"5632", "Valparaíso", |
213
|
|
|
|
|
|
|
"5653246", "Ovalle\,\ Coquimbo", |
214
|
|
|
|
|
|
|
"5663", "Valdivia\,\ Los\ Ríos", |
215
|
|
|
|
|
|
|
"5655", "Antofagasta", |
216
|
|
|
|
|
|
|
"56530", "Ovalle\,\ Coquimbo", |
217
|
|
|
|
|
|
|
"5653240", "Ovalle\,\ Coquimbo", |
218
|
|
|
|
|
|
|
"5653244", "Ovalle\,\ Coquimbo", |
219
|
|
|
|
|
|
|
"565320", "Ovalle\,\ Coquimbo", |
220
|
|
|
|
|
|
|
"56532459", "Ovalle\,\ Coquimbo", |
221
|
|
|
|
|
|
|
"5658", "Arica\,\ Arica\ and\ Parinacota", |
222
|
|
|
|
|
|
|
"565326", "Ovalle\,\ Coquimbo", |
223
|
|
|
|
|
|
|
"56211", "Santiago\,\ Metropolitan\ Region", |
224
|
|
|
|
|
|
|
"5653242", "Ovalle\,\ Coquimbo", |
225
|
|
|
|
|
|
|
"565323", "Ovalle\,\ Coquimbo", |
226
|
|
|
|
|
|
|
"5653249", "Ovalle\,\ Coquimbo", |
227
|
|
|
|
|
|
|
"5643", "Los\ Angeles\,\ Biobío", |
228
|
|
|
|
|
|
|
"5653241", "Ovalle\,\ Coquimbo", |
229
|
|
|
|
|
|
|
"56532455", "Ovalle\,\ Coquimbo", |
230
|
|
|
|
|
|
|
"5672", "Rancagua\,\ O\'Higgins", |
231
|
|
|
|
|
|
|
"5665", "Puerto\ Montt\,\ Los\ Lagos", |
232
|
|
|
|
|
|
|
"5622", "Santiago\,\ Metropolitan\ Region", |
233
|
|
|
|
|
|
|
"56532458", "Ovalle\,\ Coquimbo", |
234
|
|
|
|
|
|
|
"56533", "Ovalle\,\ Coquimbo", |
235
|
|
|
|
|
|
|
"565321", "Ovalle\,\ Coquimbo", |
236
|
|
|
|
|
|
|
"5634", "San\ Felipe\,\ Valparaíso",}; |
237
|
|
|
|
|
|
|
$areanames{es} = {"56211", "Santiago\,\ Región\ Metropolitana", |
238
|
|
|
|
|
|
|
"5622", "Santiago\,\ Región\ Metropolitana", |
239
|
|
|
|
|
|
|
"5658", "Arica\,\ Arica\ y\ Parinacota", |
240
|
|
|
|
|
|
|
"5623", "Santiago\,\ Región\ Metropolitana", |
241
|
|
|
|
|
|
|
"5661", "Punta\ Arenas\,\ Magallanes", |
242
|
|
|
|
|
|
|
"562198", "Santiago\,\ Región\ Metropolitana", |
243
|
|
|
|
|
|
|
"5667", "Coihaique\,\ Aysén", |
244
|
|
|
|
|
|
|
"5626", "Santiago\,\ Región\ Metropolitana",}; |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
sub new { |
247
|
16
|
|
|
16
|
1
|
39
|
my $class = shift; |
248
|
16
|
|
|
|
|
29
|
my $number = shift; |
249
|
16
|
|
|
|
|
101
|
$number =~ s/(^\+56|\D)//g; |
250
|
16
|
|
|
|
|
85
|
my $self = bless({ country_code => '56', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
251
|
16
|
100
|
|
|
|
75
|
return $self->is_valid() ? $self : undef; |
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
1; |