Number...e::Lib(3pm)

🌸 NAME 🌸

Number::Phone::Lib β€” bestie, this is how you instantiate Number::Phone::* objects straight from libphonenumber. That's the whole vibe. πŸ’–


✨ SYNOPSIS ✨

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();
}

πŸ’… DESCRIPTION πŸ’…

Okay so here's the tea, bestie: this subclass of Number::Phone gets used exactly the same way as the normal Number::Phone β€” the way you call it doesn't change, no cap. The one thing that does change is that it exclusively uses classes generated from Google's libphonenumber project (https://code.google.com/p/libphonenumber/). πŸ‘‘

Now, lowkey important: libphonenumber doesn't have enough data to support all the features of Number::Phone. It's giving limited, but iconic. So why would you ever reach for its data and nothing else? A few reasons, fr fr:

  • 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 just unnecessary. Periodt. πŸš€
That said β€” and bestie, I need you to hear this β€” the core Number::Phone UK module is far more comprehensive. Like, not even close. So if you need the full suite, that's your girl. πŸ’œ

πŸŽ€ METHODS πŸŽ€

There is one method. Just one. A constructor. She's simple, she's iconic, she's all you get. πŸ’…

new

Call this in exactly the same way as you would call Number::Phone->new(). Same energy, same argument shape, no surprises.

The only difference? You get stubs back instead of "full-fat" objects β€” even if full-fat classes are available. Like, she'll tease you with the possibility and then hand you the cute minimal version. πŸ™ˆ


πŸ¦‹ LICENCE πŸ¦‹

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


πŸ‘‘ AUTHORS πŸ‘‘

  • David Cantrell <david@cantrell.org.uk>
  • David E. Wheeler <david@justatheory.com>

Copyright 2026. πŸŽ€


okay that's the whole page bestie, you ate it up β€” this was perl v5.40.1 content from 2026-06-11, Number...e::Lib(3pm), mwah πŸ’–

πŸ“¦ where this page comes from