Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Number::Phone and friends
Perl Shell
Branch: master
Pull request Compare This branch is 330 commits behind DrHyde:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


* I don't want to maintain the NANP modules myself, so can some NANPish *
* person please contact me to arrange to take them over yourself.  You  *
* will need to have an interest in telecoms and I would prefer someone  *
* who is on the telnum-l mailing list or something similar so that you  *
* will be kept up to date with changes.                                 *

This distribution contains several modules.

To install them modules, do the usual dance:

    perl Makefile.PL
    make test
    make install

Number::Phone is a base class for parsing and dealing with phone numbers.

Number::Phone::UK inherits methods from it, over-riding some with UK-
specific implementations.  The intention is that other people will write
other country-specific classes exposing the same API.

Number::Phone::NANP implements functionality common to all NANP countries.
There is a subclass of this for each such country.

Number::Phone::Country is a useful module which is used by the NANP modules.
It was originally written by T. J. Mather but is now maintained by me.

Please note that the build-data.* files are not intended for your use.
I use them to re-build the database of UK number allocations.  If you
choose to use them, on your own head be it!

The data used in these modules have come from all sorts of places.  Most
of them disclaim any responsibility for errors in the data.  I disclaim
all responsibility for errors too, even if my code rapes your daughter,
or makes your PBX turn purple.

Data sources used include:
  various telcos and regulatory bodies linked from the above - for UK data - for US data - for Canadian data
  google - trying to find valid phone numbers in some countries, for testing

I have tried to make sure that as far as possible all phone numbers used
in example code and in tests belong either to bodies involved in telecoms
(regulators, telcos etc) or to governments or to myself.  This has not
been possible for all numbers.  Please don't go ringing random strangers!
Something went wrong with that request. Please try again.