| 1 | package Number::Phone::NANP::DO; | ||||||||||
| 2 | |||||||||||
| 3 | # numbering plan at http://www.itu.int/itudoc/itu-t/number/d/dom/81947.html | ||||||||||
| 4 | |||||||||||
| 5 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 3 | ▶ | use base 'Number::Phone::NANP'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 3 | ▶ | use Number::Phone::Country; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 3 | our $VERSION = 1.1; | |||||||||
| 12 | |||||||||||
| 13 | 3 | my $cache = {}; | |||||||||
| 14 | |||||||||||
| 15 | # NB this module doesn't register itself, the NANP module should be | ||||||||||
| 16 | # used and will load this one as necessary | ||||||||||
| 17 | |||||||||||
| 18 | =head1 NAME | ||||||||||
| 19 | |||||||||||
| 20 | Number::Phone::NANP::DO - DO-specific methods for Number::Phone | ||||||||||
| 21 | |||||||||||
| 22 | =head1 DESCRIPTION | ||||||||||
| 23 | |||||||||||
| 24 | This class implements DO-specific methods for Number::Phone. It is | ||||||||||
| 25 | a subclass of Number::Phone::NANP, which is in turn a subclass of | ||||||||||
| 26 | Number::Phone. Number::Phone::NANP sits in the middle because all | ||||||||||
| 27 | NANP countries can share some significant chunks of code. You should | ||||||||||
| 28 | never need to C<use> this module directly, as C<Number::Phone::NANP> | ||||||||||
| 29 | will load it automatically when needed. | ||||||||||
| 30 | |||||||||||
| 31 | =head1 SYNOPSIS | ||||||||||
| 32 | |||||||||||
| 33 | use Number::Phone::NANP; | ||||||||||
| 34 | |||||||||||
| 35 | my $phone_number = Number::Phone->new('+1 809 547 1000'); | ||||||||||
| 36 | # returns a Number::Phone::NANP::DO object | ||||||||||
| 37 | |||||||||||
| 38 | =head1 METHODS | ||||||||||
| 39 | |||||||||||
| 40 | The following methods from Number::Phone are overridden: | ||||||||||
| 41 | |||||||||||
| 42 | =over 4 | ||||||||||
| 43 | |||||||||||
| 44 | =item is_tollfree | ||||||||||
| 45 | |||||||||||
| 46 | The Dominican Republic has its own toll-free numbers (presumably only | ||||||||||
| 47 | diallabled from within +1 809/829/849) with the D digit being 0 or 1. | ||||||||||
| 48 | |||||||||||
| 49 | =cut | ||||||||||
| 50 | |||||||||||
| 51 | 7 | ▶ | sub is_tollfree { | ||||||||
|
Subroutine
is_tollfree: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 52 | 7 | my $self = shift; | |||||||||
| 53 | 7 | ▶ | if(${$self} =~ /^(\+1)?8[024]9[01]/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | 6 | return 1; | |||||||||
| 55 | } | ||||||||||
| 56 | 1 | return $self->SUPER::is_tollfree(); | |||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | =item regulator | ||||||||||
| 60 | |||||||||||
| 61 | Returns information about the national telecomms regulator. | ||||||||||
| 62 | |||||||||||
| 63 | =cut | ||||||||||
| 64 | |||||||||||
| 65 | 1 | ▶ | sub regulator { 'Indotel, http://indotel.org.do/'; } | ||||||||
|
Subroutine
regulator: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 66 | |||||||||||
| 67 | =back | ||||||||||
| 68 | |||||||||||
| 69 | =head1 BUGS/FEEDBACK | ||||||||||
| 70 | |||||||||||
| 71 | Please report bugs at L<https://github.com/DrHyde/perl-modules-Number-Phone/issues>, including, if possible, a test case. | ||||||||||
| 72 | |||||||||||
| 73 | I welcome feedback from users. | ||||||||||
| 74 | |||||||||||
| 75 | =head1 LICENCE | ||||||||||
| 76 | |||||||||||
| 77 | You may use, modify and distribute this software under the same terms as | ||||||||||
| 78 | perl itself. | ||||||||||
| 79 | |||||||||||
| 80 | =head1 AUTHOR | ||||||||||
| 81 | |||||||||||
| 82 | David Cantrell E<lt>david@cantrell.org.ukE<gt> | ||||||||||
| 83 | |||||||||||
| 84 | Copyright 2026 | ||||||||||
| 85 | |||||||||||
| 86 | =cut | ||||||||||
| 87 | |||||||||||
| 88 | 3 | 1; | |||||||||