| 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::ML; | ||||||||||
| 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.20260904101550; | |||||||||
| 26 | |||||||||||
| 27 | 2 | my $formatters = [ | |||||||||
| 28 | { | ||||||||||
| 29 | 'format' => '$1', | ||||||||||
| 30 | 'intl_format' => 'NA', | ||||||||||
| 31 | 'leading_digits' => ' | ||||||||||
| 32 | 67(?: | ||||||||||
| 33 | 0[09]| | ||||||||||
| 34 | [59]9| | ||||||||||
| 35 | 77| | ||||||||||
| 36 | 8[89] | ||||||||||
| 37 | )| | ||||||||||
| 38 | 74(?: | ||||||||||
| 39 | 0[02]| | ||||||||||
| 40 | 44| | ||||||||||
| 41 | 55 | ||||||||||
| 42 | ) | ||||||||||
| 43 | ', | ||||||||||
| 44 | 'pattern' => '(\\d{4})' | ||||||||||
| 45 | }, | ||||||||||
| 46 | { | ||||||||||
| 47 | 'format' => '$1 $2 $3 $4', | ||||||||||
| 48 | 'leading_digits' => '[24-9]', | ||||||||||
| 49 | 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})' | ||||||||||
| 50 | } | ||||||||||
| 51 | ]; | ||||||||||
| 52 | |||||||||||
| 53 | 2 | my $validators = { | |||||||||
| 54 | 'fixed_line' => ' | ||||||||||
| 55 | 2(?: | ||||||||||
| 56 | 07[0-8]| | ||||||||||
| 57 | 12[67] | ||||||||||
| 58 | )\\d{4}| | ||||||||||
| 59 | (?: | ||||||||||
| 60 | 2(?: | ||||||||||
| 61 | 02| | ||||||||||
| 62 | 1[4-689] | ||||||||||
| 63 | )| | ||||||||||
| 64 | 4(?: | ||||||||||
| 65 | 0[0-4]| | ||||||||||
| 66 | 4[1-69] | ||||||||||
| 67 | ) | ||||||||||
| 68 | )\\d{5} | ||||||||||
| 69 | ', | ||||||||||
| 70 | 'geographic' => ' | ||||||||||
| 71 | 2(?: | ||||||||||
| 72 | 07[0-8]| | ||||||||||
| 73 | 12[67] | ||||||||||
| 74 | )\\d{4}| | ||||||||||
| 75 | (?: | ||||||||||
| 76 | 2(?: | ||||||||||
| 77 | 02| | ||||||||||
| 78 | 1[4-689] | ||||||||||
| 79 | )| | ||||||||||
| 80 | 4(?: | ||||||||||
| 81 | 0[0-4]| | ||||||||||
| 82 | 4[1-69] | ||||||||||
| 83 | ) | ||||||||||
| 84 | )\\d{5} | ||||||||||
| 85 | ', | ||||||||||
| 86 | 'mobile' => ' | ||||||||||
| 87 | 2(?: | ||||||||||
| 88 | 0(?: | ||||||||||
| 89 | 01| | ||||||||||
| 90 | 79 | ||||||||||
| 91 | )| | ||||||||||
| 92 | 17\\d | ||||||||||
| 93 | )\\d{4}| | ||||||||||
| 94 | (?: | ||||||||||
| 95 | 5[0-3]| | ||||||||||
| 96 | [679]\\d| | ||||||||||
| 97 | 8[2-59] | ||||||||||
| 98 | )\\d{6} | ||||||||||
| 99 | ', | ||||||||||
| 100 | 'pager' => '', | ||||||||||
| 101 | 'personal_number' => '', | ||||||||||
| 102 | 'specialrate' => '', | ||||||||||
| 103 | 'toll_free' => '80\\d{6}', | ||||||||||
| 104 | 'voip' => '' | ||||||||||
| 105 | }; | ||||||||||
| 106 | 2 | my %areanames = (); | |||||||||
| 107 | 2 | $areanames{en} = {"2232070", "Bamako", | |||||||||
| 108 | "2232072", "Bamako", | ||||||||||
| 109 | "223212", "Koulikoro", | ||||||||||
| 110 | "223214", "Mopti", | ||||||||||
| 111 | "2232071", "Bamako", | ||||||||||
| 112 | "223442", "Bamako", | ||||||||||
| 113 | "223216", "Sikasso", | ||||||||||
| 114 | "2232075", "Bamako", | ||||||||||
| 115 | "2232077", "Bamako", | ||||||||||
| 116 | "223215", "Kayes", | ||||||||||
| 117 | "223218", "Gao\/Kidal", | ||||||||||
| 118 | "223449", "Bamako", | ||||||||||
| 119 | "223202", "Bamako", | ||||||||||
| 120 | "223219", "Tombouctou", | ||||||||||
| 121 | "2232073", "Bamako", | ||||||||||
| 122 | "2232074", "Bamako", | ||||||||||
| 123 | "2232078", "Bamako", | ||||||||||
| 124 | "223443", "Bamako", | ||||||||||
| 125 | "2232076", "Bamako",}; | ||||||||||
| 126 | 2 | my $timezones = { | |||||||||
| 127 | '' => [ | ||||||||||
| 128 | 'Africa/Bamako' | ||||||||||
| 129 | ] | ||||||||||
| 130 | }; | ||||||||||
| 131 | |||||||||||
| 132 | 10 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 133 | 10 | my $class = shift; | |||||||||
| 134 | 10 | my $number = shift; | |||||||||
| 135 | 10 | $number =~ s/(^\+223|\D)//g; | |||||||||
| 136 | 10 | my $self = bless({ country_code => '223', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 137 | 10 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 138 | } | ||||||||||
| 139 | 2 | 1; | |||||||||