NAME¶
Number::Phone::UK - UK-specific methods for Number::Phone
SYNOPSIS¶
use Number::Phone;
$daves_phone = Number::Phone->new('+44 1234 567890');
METHODS¶
The following methods from Number::Phone are overridden:
- is_valid
- The number is valid within the national numbering scheme. It may or may
not yet be allocated, or it may be reserved. Any number which returns true
for any of the following methods will also be valid.
- is_allocated
- The number has been allocated to a telco for use. It may or may not yet be
in use or may be reserved.
- is_geographic
- The number refers to a geographic area.
- is_fixed_line
- The number, when in use, can only refer to a fixed line.
(we can't tell whether a number is a fixed line, but we can tell that some
are *not*).
- is_mobile
- The number, when in use, can only refer to a mobile phone.
- is_pager
- The number, when in use, can only refer to a pager.
- is_tollfree
- Callers will not be charged for calls to this number under normal
circumstances.
- is_specialrate
- The number, when in use, attracts special rates. For instance, national
dialling at local rates, or premium rates for services.
- is_adult
- The number, when in use, goes to a service of an adult nature, such as
porn.
- is_personal
- The number, when in use, goes to an individual person.
- is_corporate
- The number, when in use, goes to a business.
- is_ipphone
- The number, when in use, is terminated using VoIP.
- is_network_service
- The number is some kind of network service such as a human operator,
directory enquiries, emergency services etc
- country_code
- Returns 44.
- regulator
- Returns informational text.
- areacode
- Return the area code - if applicable - for the number. If not applicable,
returns undef.
- areaname
- Return the area name - if applicable - for the number, or undef.
- location
- For geographic numbers, this returns the location of the exchange to which
that number is assigned, if available. Otherwise returns undef.
- subscriber
- Return the subscriber part of the number
- operator
- Return the name of the telco operating this number, in an appropriate
character set and with optional details such as their web site or phone
number.
- format
- Return a sanely formatted version of the number, complete with IDD code,
eg for the UK number (0208) 771-2924 it would return +44 20 87712924.
- intra_country_dial_to
- Within the UK numbering plan you can *always* dial 0xxxx xxxxxx for
intra-country calls. In most places the leading 0$areacode is optional but
in some it is required (see
<http://consumers.ofcom.org.uk/dial-the-code/>) and over time this
will apply to more areas.
- country
- If the number is_international, return the two-letter ISO country code.
NYI
LIMITATIONS/BUGS/FEEDBACK¶
The results are only as up-to-date as the data included from OFCOM's official
documentation of number range allocations.
No attempt is made to deal with number portability.
Please report bugs at
<
https://github.com/DrHyde/perl-modules-Number-Phone/issues>, including,
if possible, a test case.
I welcome feedback from users.
LICENCE¶
You may use, modify and distribute this software under the same terms as perl
itself.
AUTHOR¶
David Cantrell <david@cantrell.org.uk>
Copyright 2012