Number::Phone::Lib(3pm)

Number::Phone::Lib3pm

Instantiate number::phone::* objects from libphonenumber

Usage

    use Number::Phone::Lib;
    $daves_phone = Number::Phone::Lib->new('+442087712924');
    $daves_other_phone = Number::Phone::Lib->new('+44 7979 866 975');
    # alternatively      Number::Phone::Lib->new('+44', '7979 866 975');
    # or                 Number::Phone::Lib->new('UK', '07979 866 975');
    if ( $daves_phone->is_mobile() ) {
        send_rude_SMS();
    }

This subclass of Number::Phone is used in exactly the same way as the normal Number::Phone, but it exclusively uses classes generated from Google's libphonenumber project <https://code.google.com/p/libphonenumber/>. libphonenumber doesn't have enough data to support all the features of Number::Phone, but you might want to use its data and no other for a few reasons:

•

Compatibility with libphonenumber's Java, C++, and JavaScript implementations.

•

Performance. UK Number parsing and validation by Number::Phone::UK, in particular, has a substantial overhead thanks to its embedded database. If all you need is simple validation and/or formatting, all that overhead is unnecessary.

That said, the core Number::Phone UK module is far more comprehensive.

Methods

There is one method, a constructor:

new

Call this in exactly the same way as you would call "Number::Phone-"new()>. The only difference is that you will get stubs back instead of "full-fat" objects, even if full-fat classes are available.

Licence

You may use, modify and distribute this software under the same terms as perl itself.

Releases

6 releases since Debian 8 (Jessie); the text changed 5 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13

Authors

•

David Cantrell <[email protected]>

•

David E. Wheeler <[email protected]>

Copyright 2025

From libnumber-phone-perl 4.0006-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.