.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Number::Phone::NANP 3pm" .TH Number::Phone::NANP 3pm "2018-12-16" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Number::Phone::NANP \- NANP\-specific methods for Number::Phone .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a base class which encapsulates that information about phone numbers in the North American Numbering Plan (\s-1NANP\s0) which are common to all \s-1NANP\s0 countries \- that is, those whose international dialling code is +1. .PP Country-specific modules should inherit from this module and provide their own versions of methods as necessary. However, they should not provide an \f(CW\*(C`is_valid\*(C'\fR method or a constructor. .SH "SYNOPSIS" .IX Header "SYNOPSIS" This module should not be used directly. It will be loaded as necessary by Number::Phone: .PP .Vb 1 \& use Number::Phone; \& \& my $phone_number = Number::Phone\->new(\*(Aq+1 202 418 1440\*(Aq); \& # $phone_number is now a Number::Phone::NANP::US \& \& my $other_phone_number = Number::Phone\->new(\*(Aq+1 866 623 2282\*(Aq); \& # $phone_number is non\-geographic so is a Number::Phone::NANP .Ve .SH "METHODS" .IX Header "METHODS" The following methods from Number::Phone are overridden: .IP "new" 4 .IX Item "new" The constructor, you should never have to call this yourself. To create an object the canonical incantation is \f(CW\*(C`Number::Phone\-\*(C'\fRnew('+1 ...')>. .IP "is_valid" 4 .IX Item "is_valid" The number is valid within the numbering scheme. It may or may not yet be allocated, or it may be reserved. .IP "is_geographic" 4 .IX Item "is_geographic" NANP-globals like 1\-800 aren't geographic, the rest are. .IP "is_mobile" 4 .IX Item "is_mobile" NANP-globals like 1\-800 aren't mobile. For most others we just don't know because the data isn't published. libphonenumber has data for *some* countries, so we use that if we can. .IP "is_fixed_line" 4 .IX Item "is_fixed_line" NANP-globals are fixed lines, for the rest we generally don't know with some exceptions as per is_mobile above. .IP "is_drama" 4 .IX Item "is_drama" The number is a '555' number. Numbers with the D, E, and F digits set to 555 are not allocated to real customers, and are intended for use in fiction. eg 212 555 2368 for Ghostbusters. .Sp \&\s-1NB,\s0 despite Ghostbusters above, only 555\-0100 to 555\-0199 are actually reserved. .IP "is_government" 4 .IX Item "is_government" Area code 710 is reserved for the \s-1US\s0 Feds, but apparently only one number in the whole area code works. .IP "is_tollfree" 4 .IX Item "is_tollfree" The number is free to the caller. 800, 844, 855, 866, 877 and 888 \*(L"area codes\*(R" .IP "is_specialrate" 4 .IX Item "is_specialrate" The number is charged at a higher rate than normal. The 900 \*(L"area code\*(R" and some parts of 242 and 246 (Bahamas and Barbados). .IP "is_personal" 4 .IX Item "is_personal" The number is a \*(L"personal\*(R" number. The 500, 533, 544, 566 and 577 \*(L"area codes\*(R". .IP "country_code" 4 .IX Item "country_code" Returns 1. .IP "regulator" 4 .IX Item "regulator" Returns informational text relevant to the whole \s-1NANP.\s0 Note that when this method is inherited by a subclass it returns undef meaning \*(L"not known\*(R", but returns information about the \s-1NANPA\s0 when called on an object of class Number::Phone::NANP. .IP "areacode" 4 .IX Item "areacode" Return the area code for the number. .IP "areaname" 4 .IX Item "areaname" Return the name for the area code, if applicable, otherwise returns undef. For instance, for a number beginning with +1 201 200 it would return \*(L"Jersey City, \s-1NJ\*(R".\s0 .IP "subscriber" 4 .IX Item "subscriber" Return the subscriber part of the number. .IP "format" 4 .IX Item "format" Return a sanely formatted version of the number, complete with \s-1IDD\s0 code. .SH "BUGS/FEEDBACK" .IX Header "BUGS/FEEDBACK" Please report bugs at , including, if possible, a test case. .PP I welcome feedback from users. .SH "LICENCE" .IX Header "LICENCE" You may use, modify and distribute this software under the same terms as perl itself. .SH "AUTHOR" .IX Header "AUTHOR" David Cantrell .PP Copyright 2012