Number-Phone

 view release on metacpan or  search on metacpan

CHANGELOG  view on Meta::CPAN


2020-05-11      3.6004  Data updates;
                        Improved doco on the data update policy :-)

2020-04-27      3.6003  Testing improvements for fork()ing code;
                        Data updates

2020-03-09      3.6002  Data updates

2019-12-11      3.6001  Inmarsat +871 to +874 have been de-commissioned;
                        Added some US overlay codes (not all are in use yet);
                        Data updates

2019-09-12      3.6000  Data updates;
                        UK is_drama() numbers now all respond appropriately
                          to is_mobile, is_tollfree etc, and the mobile range
                          is correctly identified as being UK-wide and not Jersey
                          (see https://github.com/DrHyde/perl-modules-Number-Phone/issues/67);
                        Areaname() sensitive to your locale

2019-06-11      3.5001  Corrected international dialling data for Antarctic

CHANGELOG  view on Meta::CPAN

2007-06-01      1.58    Number::Phone::Country updated to reflect KM/YT split
                          Mayotte moved into parts of +262, so now shares with
                          Reunion instead of Comoros
                        New UK allocations (in particular 03 range)
2007-03-13      1.57    New UK allocations;
                        Bundle DBM::Deep cos old version is incompatible
2007-02-24      1.5601  New UK allocations
2006-12-08      1.56    New UK allocations;
                        Updated OFCOM parser;
                        Loads of Number::Phone::Country updates -
                          +1: NANP overlays: 226, 438, 762, 769, 829;
                          +269: Split Mayotte/Comores;
                          +381/2: Yugoslavia's *still* breaking up! (RS and ME);
                          +61 89162/4: Cocos and Christmas islands
                          +672 3: Norfolk Island
                          +672 1 0/1/2/3: Australian Antarctic bases
                          +681: Wallace and Futuna (corrected CCTLD)
                          +881 0: ICO Global
                          +881 3: Ellipso
                          +881 6: Iridium
                          +881 7: Iridium

lib/Number/Phone.pm  view on Meta::CPAN

number formatted either nationally-formatted, if the number is in the same
country, or as a nationally-preferred international number if not. Internally
this uses the National and NationallyPreferredIntl formatters. Beware of the
potential performance hit!

=item country

The two letter ISO country code for the country in which the call will
terminate.  This is implemented in the superclass and you will only have
to implement your own version for countries where part of the number
range is overlayed with another country.

Exception: for the UK, return 'uk', not 'gb'.

Specifically, the superclass implementation looks at the class name and
returns the last two-letter code it finds.  eg ...

  from Number::Phone::UK, it would return UK
  from Number::Phone::UK::IM, it would return IM
  from Number::Phone::NANP::US, it would return US
  from Number::Phone::FR::Full, it would return FR

lib/Number/Phone/Country.pm  view on Meta::CPAN

        ));
        # handful of non-geographic country-specific codes ...
        # see https://en.wikipedia.org/wiki/Area_code_600
        # checked on 2025-03-23
        # next check due 2026-01-01 (annually)
        $canada = join('|', $canada, 600, 622, 633, 644, 655, 677, 688);
    },
    US => do {
        # see https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes#United_States
        #   and https://www.allareacodes.com/area_code_listings_by_state.htm
        #   but the latter doesn't contain some overlays that are about to come into service
        # NB for Hyder, Alaska, it shares three COs with Stewart, BC, and we can't tell which number is in which country,
        #   so those prefixes aren't listed here
        # checked on 2025-03-23
        # next check due 2026-01-01 (annually)
        my $usa = join('|', qw(
            205 251 256 334 483 659 938
            907
            480 520 602 623 928
            327 479 501 870
            209 213 279 310 323 341 350 357 369 408 415 424 442 510 530 559 562 619 626 628 650 657 661 669 707 714 738 747 760 805 818 820 831 837 840 858 909 916 925 949 951

lib/Number/Phone/Country.pm  view on Meta::CPAN

It has not been possible to maintain complete backwards compatibility with
the original 0.01 release.  To fix a
bug, while still retaining the ability to look up plain un-adorned NANP
numbers without the +1 prefix, all non-NANP numbers *must* have their
leading + sign.

Another incompatibility - it was previously assumed that any number not
assigned to some other country was in the US.  This was incorrect for (eg)
800 numbers.  These are now identified as being generic NANP numbers.

Will go out of date every time the NANP has one of its code splits/overlays.
So that's about once a month then.  I'll do my best to keep it up to date.

=head1 WARNING

The Yugoslavs keep changing their minds about what country they want to be
and what their ISO 3166 code and IDD prefix should be.  YU? CS? RS? ME?
God knows.  And then there's Kosovo ...

=head1 AUTHOR



( run in 0.281 second using v1.01-cache-2.11-cpan-26ccb49234f )