Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

drhyde (1683)

  (email not shown publicly)

Journal of drhyde (1683)

Thursday September 23, 2004
04:12 AM


[ #21018 ]
Many months ago, I muttered at some of the many people who maintain modules in the CPAN which deal with phone numbers. They're all good modules, but have no common interface. Which sucks. If I'm dealing with phone numbers, I want to have the same interface to those numbers, where possible, regardless of whether I'm looking at a Japanese number or a German number. So I proposed a common interface, based on the sort of functionality I wanted when I was working for a telco and doing calculations based on phone numbers for a living. The feedback was pretty positive.

Fast forward to a month ago, and I had finally finished Number::Phone version 1.0, a generic superclass. On top of that, I implemented Number::Phone::UK which tells you whether a given UK number is a land line, a mobile, which telco terminates it, and so on. Since then I've released two updates, which are largely to do with updates in the UK numbering plan, such as new number ranges being allocated.

I'd really like some feedback on the API from other people.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Looks okay from a quick glance. I worry a bit about regulator because you're mixing a description of the regulator with an identifier. This would make it hard to compare regulators for equality if, say, it was the same regulator but they had different telephone numbers for different countries (I know this wouldn't normally make sense, but I can imagine some weird cases where you'd have cross country regulators.)
    • The only cases I can think of are the North American Numbering Plan (NANP), but the intention is to put generic NANP-ish stuff in N::P::NANP with country-specific subclasses; and Russia/Kazakhstan which share +7.