NAME
Number::Phone::PT - Validate Portuguese phone numbers
SYNOPSIS
use Number::Phone::PT;
print "$number is valid" if is_valid($number);
print "$number belongs to a home" if is_residential($number);
print "$number is a celular phone" if is_mobile($number);
print "$number belongs to someone" if is_personal($number);
# same thing as ( is_residential($number) or is_mobile($number) )
print "$number is from " . area_of($number) if is_residential($number);
DESCRIPTION
Validates Portuguese phone numbers. Does not check whether they exist or not; it just validates to see if they are well written.
Special numbers (as the emergency number 112, for instance), are currently not comtemplated.
PORTUGUESE PHONE NUMBERS
There are three kinds of telephone numbers in Portugal (currently): residential, mobile and service numbers.
All of these numbers are composed of nine digits.
RESIDENTIAL NUMBERS
Residential numbers always start with the digit 2. The first few digits identify the region it belongs to. Here is the list (note that the function area_of
may return accentuated words):
- 21 lisboa
- 22 porto
- 231 mealhada
- 232 mangualde,tondela,viseu
- 233 figueira da foz
- 234 aveiro,agueda
- 236 pombal
- 239 coimbra,condeixa,penacova
- 242 santarem
- 243 santarem
- 244 marinha grande,leiria
- 245 portalegre
- 249 tomar,torres novas
- 251 valenca
- 252 famalicao,povoa do varzim,santo tirso,trofa
- 253 braga,fafe,guimaraes,barcelos
- 254 regua
- 255 amarante,felgueiras,penafiel
- 256 ovar,sao joao da madeira
- 258 viana do castelo
- 259 vila real
- 261 mafra,torres vedras,lourinha
- 263 caldas da rainha,peniche
- 265 setubal
- 266 evora
- 268 estremoz
- 269 santiago do cacem
- 271 guarda
- 272 castelo branco
- 273 braganca
- 274 serta
- 275 covilha
- 276 chaves
- 277 castelo branco
- 278 mirandela
- 279 moncorvo
- 281 tavira
- 282 lagos,portimao
- 283 beja
- 284 beja
- 285 beja
- 286 beja
- 289 faro,quarteira
- 291 funchal
- 292 horta,madalena,santa cruz das flores
- 295 angra do heroismo
- 296 ponta delgada
MOBILE NUMBERS
Mobile numbers always start with the digit 9. The first two digits identify the operator it belongs to. Here is the list:
SERVICE NUMBERS
Service numbers start with 707, 760, 800 or 808 (currently). Please refer to Portugal Telecom in order to know how they work.
AUTHOR
Jose Alves de Castro, <jac@natura.di.uminho.pt<gt>
COPYRIGHT AND LICENSE
Copyright 2004 by Jose Alves de Castro
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
4 POD Errors
The following errors were encountered while parsing the POD:
- Around line 173:
=over should be: '=over' or '=over positive_number'
- Around line 276:
=over should be: '=over' or '=over positive_number'
- Around line 291:
=over should be: '=over' or '=over positive_number'
- Around line 293:
Non-ASCII character seen before =encoding in 'número'. Assuming CP1252