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::CA; |
20
|
2
|
|
|
2
|
|
1123
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
271
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
22
|
use strict; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
53
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
61
|
|
24
|
2
|
|
|
2
|
|
18
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
16
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131444; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1-$2', |
30
|
|
|
|
|
|
|
'leading_digits' => '310', |
31
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
'format' => '$1-$2', |
35
|
|
|
|
|
|
|
'intl_format' => 'NA', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
[24-9]| |
38
|
|
|
|
|
|
|
3(?: |
39
|
|
|
|
|
|
|
[02-9]| |
40
|
|
|
|
|
|
|
1[1-9] |
41
|
|
|
|
|
|
|
) |
42
|
|
|
|
|
|
|
', |
43
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
{ |
46
|
|
|
|
|
|
|
'format' => '($1) $2-$3', |
47
|
|
|
|
|
|
|
'intl_format' => '$1-$2-$3', |
48
|
|
|
|
|
|
|
'leading_digits' => '[2-9]', |
49
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{4})' |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
]; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $validators = { |
54
|
|
|
|
|
|
|
'geographic' => '( |
55
|
|
|
|
|
|
|
(?: |
56
|
|
|
|
|
|
|
2(?: |
57
|
|
|
|
|
|
|
04| |
58
|
|
|
|
|
|
|
[23]6| |
59
|
|
|
|
|
|
|
[48]9| |
60
|
|
|
|
|
|
|
50| |
61
|
|
|
|
|
|
|
63 |
62
|
|
|
|
|
|
|
)| |
63
|
|
|
|
|
|
|
3(?: |
64
|
|
|
|
|
|
|
06| |
65
|
|
|
|
|
|
|
43| |
66
|
|
|
|
|
|
|
54| |
67
|
|
|
|
|
|
|
6[578]| |
68
|
|
|
|
|
|
|
82 |
69
|
|
|
|
|
|
|
)| |
70
|
|
|
|
|
|
|
4(?: |
71
|
|
|
|
|
|
|
03| |
72
|
|
|
|
|
|
|
1[68]| |
73
|
|
|
|
|
|
|
[26]8| |
74
|
|
|
|
|
|
|
3[178]| |
75
|
|
|
|
|
|
|
50| |
76
|
|
|
|
|
|
|
74 |
77
|
|
|
|
|
|
|
)| |
78
|
|
|
|
|
|
|
5(?: |
79
|
|
|
|
|
|
|
06| |
80
|
|
|
|
|
|
|
1[49]| |
81
|
|
|
|
|
|
|
48| |
82
|
|
|
|
|
|
|
79| |
83
|
|
|
|
|
|
|
8[147] |
84
|
|
|
|
|
|
|
)| |
85
|
|
|
|
|
|
|
6(?: |
86
|
|
|
|
|
|
|
04| |
87
|
|
|
|
|
|
|
[18]3| |
88
|
|
|
|
|
|
|
39| |
89
|
|
|
|
|
|
|
47| |
90
|
|
|
|
|
|
|
72 |
91
|
|
|
|
|
|
|
)| |
92
|
|
|
|
|
|
|
7(?: |
93
|
|
|
|
|
|
|
0[59]| |
94
|
|
|
|
|
|
|
42| |
95
|
|
|
|
|
|
|
53| |
96
|
|
|
|
|
|
|
78| |
97
|
|
|
|
|
|
|
8[02] |
98
|
|
|
|
|
|
|
)| |
99
|
|
|
|
|
|
|
8(?: |
100
|
|
|
|
|
|
|
[06]7| |
101
|
|
|
|
|
|
|
19| |
102
|
|
|
|
|
|
|
25| |
103
|
|
|
|
|
|
|
73 |
104
|
|
|
|
|
|
|
)| |
105
|
|
|
|
|
|
|
90[25] |
106
|
|
|
|
|
|
|
)[2-9]\\d{6} |
107
|
|
|
|
|
|
|
| |
108
|
|
|
|
|
|
|
(?: |
109
|
|
|
|
|
|
|
2(?: |
110
|
|
|
|
|
|
|
04| |
111
|
|
|
|
|
|
|
[23]6| |
112
|
|
|
|
|
|
|
[48]9| |
113
|
|
|
|
|
|
|
50| |
114
|
|
|
|
|
|
|
63 |
115
|
|
|
|
|
|
|
)| |
116
|
|
|
|
|
|
|
3(?: |
117
|
|
|
|
|
|
|
06| |
118
|
|
|
|
|
|
|
43| |
119
|
|
|
|
|
|
|
54| |
120
|
|
|
|
|
|
|
6[578]| |
121
|
|
|
|
|
|
|
82 |
122
|
|
|
|
|
|
|
)| |
123
|
|
|
|
|
|
|
4(?: |
124
|
|
|
|
|
|
|
03| |
125
|
|
|
|
|
|
|
1[68]| |
126
|
|
|
|
|
|
|
[26]8| |
127
|
|
|
|
|
|
|
3[178]| |
128
|
|
|
|
|
|
|
50| |
129
|
|
|
|
|
|
|
74 |
130
|
|
|
|
|
|
|
)| |
131
|
|
|
|
|
|
|
5(?: |
132
|
|
|
|
|
|
|
06| |
133
|
|
|
|
|
|
|
1[49]| |
134
|
|
|
|
|
|
|
48| |
135
|
|
|
|
|
|
|
79| |
136
|
|
|
|
|
|
|
8[147] |
137
|
|
|
|
|
|
|
)| |
138
|
|
|
|
|
|
|
6(?: |
139
|
|
|
|
|
|
|
04| |
140
|
|
|
|
|
|
|
[18]3| |
141
|
|
|
|
|
|
|
39| |
142
|
|
|
|
|
|
|
47| |
143
|
|
|
|
|
|
|
72 |
144
|
|
|
|
|
|
|
)| |
145
|
|
|
|
|
|
|
7(?: |
146
|
|
|
|
|
|
|
0[59]| |
147
|
|
|
|
|
|
|
42| |
148
|
|
|
|
|
|
|
53| |
149
|
|
|
|
|
|
|
78| |
150
|
|
|
|
|
|
|
8[02] |
151
|
|
|
|
|
|
|
)| |
152
|
|
|
|
|
|
|
8(?: |
153
|
|
|
|
|
|
|
[06]7| |
154
|
|
|
|
|
|
|
19| |
155
|
|
|
|
|
|
|
25| |
156
|
|
|
|
|
|
|
73 |
157
|
|
|
|
|
|
|
)| |
158
|
|
|
|
|
|
|
90[25] |
159
|
|
|
|
|
|
|
)[2-9]\\d{6} |
160
|
|
|
|
|
|
|
)', |
161
|
|
|
|
|
|
|
'pager' => '', |
162
|
|
|
|
|
|
|
'personal_number' => ' |
163
|
|
|
|
|
|
|
52(?: |
164
|
|
|
|
|
|
|
3(?: |
165
|
|
|
|
|
|
|
[2-46-9][02-9]\\d| |
166
|
|
|
|
|
|
|
5(?: |
167
|
|
|
|
|
|
|
[02-46-9]\\d| |
168
|
|
|
|
|
|
|
5[0-46-9] |
169
|
|
|
|
|
|
|
) |
170
|
|
|
|
|
|
|
)| |
171
|
|
|
|
|
|
|
4(?: |
172
|
|
|
|
|
|
|
[2-478][02-9]\\d| |
173
|
|
|
|
|
|
|
5(?: |
174
|
|
|
|
|
|
|
[034]\\d| |
175
|
|
|
|
|
|
|
2[024-9]| |
176
|
|
|
|
|
|
|
5[0-46-9] |
177
|
|
|
|
|
|
|
)| |
178
|
|
|
|
|
|
|
6(?: |
179
|
|
|
|
|
|
|
0[1-9]| |
180
|
|
|
|
|
|
|
[2-9]\\d |
181
|
|
|
|
|
|
|
)| |
182
|
|
|
|
|
|
|
9(?: |
183
|
|
|
|
|
|
|
[05-9]\\d| |
184
|
|
|
|
|
|
|
2[0-5]| |
185
|
|
|
|
|
|
|
49 |
186
|
|
|
|
|
|
|
) |
187
|
|
|
|
|
|
|
) |
188
|
|
|
|
|
|
|
)\\d{4}| |
189
|
|
|
|
|
|
|
52[34][2-9]1[02-9]\\d{4}| |
190
|
|
|
|
|
|
|
(?: |
191
|
|
|
|
|
|
|
5(?: |
192
|
|
|
|
|
|
|
00| |
193
|
|
|
|
|
|
|
2[125-9]| |
194
|
|
|
|
|
|
|
33| |
195
|
|
|
|
|
|
|
44| |
196
|
|
|
|
|
|
|
66| |
197
|
|
|
|
|
|
|
77| |
198
|
|
|
|
|
|
|
88 |
199
|
|
|
|
|
|
|
)| |
200
|
|
|
|
|
|
|
622 |
201
|
|
|
|
|
|
|
)[2-9]\\d{6} |
202
|
|
|
|
|
|
|
', |
203
|
|
|
|
|
|
|
'specialrate' => '(900[2-9]\\d{6})|(310\\d{4})', |
204
|
|
|
|
|
|
|
'toll_free' => ' |
205
|
|
|
|
|
|
|
8(?: |
206
|
|
|
|
|
|
|
00| |
207
|
|
|
|
|
|
|
33| |
208
|
|
|
|
|
|
|
44| |
209
|
|
|
|
|
|
|
55| |
210
|
|
|
|
|
|
|
66| |
211
|
|
|
|
|
|
|
77| |
212
|
|
|
|
|
|
|
88 |
213
|
|
|
|
|
|
|
)[2-9]\\d{6} |
214
|
|
|
|
|
|
|
', |
215
|
|
|
|
|
|
|
'voip' => '600[2-9]\\d{6}' |
216
|
|
|
|
|
|
|
}; |
217
|
2
|
|
|
2
|
|
368
|
use Number::Phone::NANP::Data; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
1638
|
|
218
|
|
|
|
|
|
|
sub areaname { |
219
|
1
|
|
|
1
|
1
|
8
|
Number::Phone::NANP::Data::_areaname('1'.shift()->{number}); } |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
sub new { |
222
|
17
|
|
|
17
|
1
|
43
|
my $class = shift; |
223
|
17
|
|
|
|
|
35
|
my $number = shift; |
224
|
17
|
|
|
|
|
115
|
$number =~ s/(^\+1|\D)//g; |
225
|
17
|
|
|
|
|
95
|
my $self = bless({ country_code => '1', number => $number, formatters => $formatters, validators => $validators, }, $class); |
226
|
17
|
100
|
|
|
|
102
|
return $self->is_valid() ? $self : undef; |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
1; |