[Number-phone] Number Phone release candidate 3.8099_01 - please test!
David Cantrell
david at cantrell.org.uk
Thu Jan 12 23:47:54 GMT 2023
I've recently tackled a feature request that's been sitting in the
backlog for several years, to use libphonenumber's data to validate
numbers with non-geographic country codes. That's codes like +800
(international freephone), +870 (Inmarsat) and so on.
Previous versions would sort of work with these numbers, in that they
could be instantiated as objects, but there was no information on
validity or any other properties.
For example here it's looking at an Iridium number. First with the
previous release:
Number::Phone->new("+881 672520333333333333333732")->format()
+8816 72520333333333333333732
Number::Phone->new("+881 672520732")->is_mobile()
undef (ie, dunno)
and with the release candidate:
Number::Phone->new("+881 672520333333333333333732")
undef (ie, not valid)
Number::Phone->new("+881 672520732")->format()
+881 6 725 20732
Number::Phone->new("+881 672520732")->is_mobile()
1
This involved quite a bit of hacking around in the build system and
object instantiation, so there's the potential for exciting new bugs
even for numbers in boring old geographic country codes, although I
didn't have to change any of the existing tests so I am hopeful that I
avoided that. Here's the changes:
https://github.com/DrHyde/perl-modules-Number-Phone/pull/114/files
I'd be grateful if you could test this, and assuming that no-one finds
any bugs it will be in either the March or June quarterly release. You
can download it from here:
https://cpan.metacpan.org/authors/id/D/DC/DCANTRELL/Number-Phone-3.8099_01.tar.gz
--
David Cantrell
More information about the number-phone
mailing list