Number::Phone::DE::Mobile Check German Mobile Phone Numbers for validity and put them into a standard format.
use Number::Phone::DE::Mobile qw(checkmsisdn); $checkedmsisdn = Number::Phone::DE::Mobile->checkmsisdn($rawmsisdn);
Number::Phone::DE::Mobile is a simple module to validate German Mobile Phone Numbers (MSISDNs) and return them in a single format.
regarding the fact, that mobile phone msisdns can contain 7 or 8 digits behind the area code and also regarding the various msisdn-output formats on wap gateways, sms-servers etc. i wrote a small perl-module that transforms all msisdns, no matter what input-format you use, into one, standard output format:
xxyyyzzzzzzzz where: x = country code y = area code z = subscriber number (either 7 or 8 digits...)
basically there are 10 types of msisdn-notations that are possible at present and that are supported by the module: 7-digit numbers:
0049___17x_____1234567_____=14 digits
34_____17x_____1234567_____=12 digits
00_____17x_____1234567_____=12 digits
0______17x_____1234567_____=11 digits
_______17x_____1234567_____=10 digits
8-digit numbers:
0049___17x_____12345678____=15 digits
34_____17x_____12345678____=13 digits
00_____17x_____12345678____=13 digits
0______17x_____12345678____=12 digits
_______17x_____12345678____=11 digits
comments: 1) the country code can be any number not starting with a zero. (this will work for nearly all countries except countries with a single digit country code.)
2) the area code can be any 3-digit number starting with "1" (i.e.: 179, 176, 150, 160, 168 etc...)
3) a leading "+" sign will be translated into two zeros "00" before its processed
4) special characters like "+","&",";","_","-","." will be deleted from the msisdn before its processed
5) if the msisdn is not ok, the program returns "invalid".
This module is published under the GPL.
perl(1)
Karsten Pawlik Mailto: netsrak@cpan.org Web: http://www.designlab.de
To install Number::Phone::DE::Mobile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Number::Phone::DE::Mobile
CPAN shell
perl -MCPAN -e shell install Number::Phone::DE::Mobile
For more information on module installation, please visit the detailed CPAN module installation guide.