| 1 | # automatically generated file, don't edit | ||||||||||
| 2 | |||||||||||
| 3 | |||||||||||
| 4 | |||||||||||
| 5 | # Copyright 2026 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::PG; | ||||||||||
| 20 | 2 | ▶ | use base qw(Number::Phone::StubCountry); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 2 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 2 | our $VERSION = 1.20260904101551; | |||||||||
| 26 | |||||||||||
| 27 | 2 | my $formatters = [ | |||||||||
| 28 | { | ||||||||||
| 29 | 'format' => '$1 $2', | ||||||||||
| 30 | 'leading_digits' => ' | ||||||||||
| 31 | 18| | ||||||||||
| 32 | [2-69]| | ||||||||||
| 33 | 85[02-46-9] | ||||||||||
| 34 | ', | ||||||||||
| 35 | 'pattern' => '(\\d{3})(\\d{4})' | ||||||||||
| 36 | }, | ||||||||||
| 37 | { | ||||||||||
| 38 | 'format' => '$1 $2', | ||||||||||
| 39 | 'leading_digits' => '[78]', | ||||||||||
| 40 | 'pattern' => '(\\d{4})(\\d{4})' | ||||||||||
| 41 | } | ||||||||||
| 42 | ]; | ||||||||||
| 43 | |||||||||||
| 44 | 2 | my $validators = { | |||||||||
| 45 | 'fixed_line' => ' | ||||||||||
| 46 | (?: | ||||||||||
| 47 | (?: | ||||||||||
| 48 | 3[0-2]| | ||||||||||
| 49 | 4[257]| | ||||||||||
| 50 | 5[34]| | ||||||||||
| 51 | 9[78] | ||||||||||
| 52 | )\\d| | ||||||||||
| 53 | 64[1-9]| | ||||||||||
| 54 | 85[02-46-9] | ||||||||||
| 55 | )\\d{4} | ||||||||||
| 56 | ', | ||||||||||
| 57 | 'geographic' => ' | ||||||||||
| 58 | (?: | ||||||||||
| 59 | (?: | ||||||||||
| 60 | 3[0-2]| | ||||||||||
| 61 | 4[257]| | ||||||||||
| 62 | 5[34]| | ||||||||||
| 63 | 9[78] | ||||||||||
| 64 | )\\d| | ||||||||||
| 65 | 64[1-9]| | ||||||||||
| 66 | 85[02-46-9] | ||||||||||
| 67 | )\\d{4} | ||||||||||
| 68 | ', | ||||||||||
| 69 | 'mobile' => ' | ||||||||||
| 70 | (?: | ||||||||||
| 71 | 7\\d| | ||||||||||
| 72 | 8[1-58] | ||||||||||
| 73 | )\\d{6} | ||||||||||
| 74 | ', | ||||||||||
| 75 | 'pager' => '27[01]\\d{4}', | ||||||||||
| 76 | 'personal_number' => '', | ||||||||||
| 77 | 'specialrate' => '', | ||||||||||
| 78 | 'toll_free' => '180\\d{4}', | ||||||||||
| 79 | 'voip' => ' | ||||||||||
| 80 | 2(?: | ||||||||||
| 81 | 0[0-57]| | ||||||||||
| 82 | 7[568] | ||||||||||
| 83 | )\\d{4} | ||||||||||
| 84 | ' | ||||||||||
| 85 | }; | ||||||||||
| 86 | 2 | my %areanames = (); | |||||||||
| 87 | 2 | $areanames{en} = {"6755", "Highlands", | |||||||||
| 88 | "67545", "Sepik", | ||||||||||
| 89 | "67542", "Madang", | ||||||||||
| 90 | "6756", "MP\/Gulf\/Tabubil\/Kiunga", | ||||||||||
| 91 | "6753", "NCD", | ||||||||||
| 92 | "67547", "Morobe", | ||||||||||
| 93 | "6759", "Islands",}; | ||||||||||
| 94 | 2 | my $timezones = { | |||||||||
| 95 | '' => [ | ||||||||||
| 96 | 'Pacific/Port_Moresby' | ||||||||||
| 97 | ] | ||||||||||
| 98 | }; | ||||||||||
| 99 | |||||||||||
| 100 | 16 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 101 | 16 | my $class = shift; | |||||||||
| 102 | 16 | my $number = shift; | |||||||||
| 103 | 16 | $number =~ s/(^\+675|\D)//g; | |||||||||
| 104 | 16 | my $self = bless({ country_code => '675', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 105 | 16 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 106 | } | ||||||||||
| 107 | 2 | 1; | |||||||||