Parse::PhoneNumber - Parse Phone Numbers
use Parse::PhoneNumber; my $number = Parse::PhoneNumber->parse( number => $phone ); print $number->human;
Parse phone numbers. Phone number have a defined syntax (to a point), so they can be parsed (to a point).
Create a new Parse::PhoneNumber object. Useful if a lot of numbers have to be parsed.
Accepts a list of arguments. number is the phone number. This method will return undef and set errstr on failure. On success, a Parse::PhoneNumber::Number object is returned. assume_us will have the country code default to 1 if none is given. This is due to the fact that most people in the US are clueless about such things.
number
undef
errstr
Parse::PhoneNumber::Number
assume_us
1
Returns the last error reported, or undef if no errors have occured yet.
The objects returned on a successful parse.
The original string passed to parse.
parse
The Country Code
The phone number, including the trunk pointer, area code, and subscriber number.
An extension, if one is present.
The format an OpenSRS Registrar must make a phone number for some TLDs.
Human readable format.
Currently only accept phone numbers in International format. If a number isn't given in international format, a false positive could occur.
Please report bugs to the CPAN RT instance at https://rt.cpan.org/Dist/Display.html?Queue=Parse-PhoneNumber
Number::Phone
Casey West <casey@geeknest.com>
Maintained by Tim Wilde <cpan@krellis.org>
Copyright (c) 2003 Casey West <casey@geeknest.com>.
Portions Copyright (c) 2005 Dynamic Network Services, Inc.
Portions Copyright (c) 2011 Tim Wilde
Portions Copyright (c) 2012 Google, Inc.
All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Parse::PhoneNumber, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parse::PhoneNumber
CPAN shell
perl -MCPAN -e shell install Parse::PhoneNumber
For more information on module installation, please visit the detailed CPAN module installation guide.