Number::Phone::Formatter::NationalDigits - A Number::Phone formatter for the national digits only.


version 0.01


 # option 1: use with Number::Phone
 # prints 2087712924
 my $number = Number::Phone->new('+44 20 8771 2924');
 print $number->format_using('NationalDigits');

 # Option 2: use standaline, without Number::Phone
 # prints: 2087712924
 print Number::Phone::Formatter::NationalDigits->format('+44 20 8771 2924');


This is a formatter that will format an E.123 formatted number (e.g. from Number::Phone) as the National portion of the number, with all non-digits removed. This is the same thing that Number::Phone::Formatter::Raw does, except you can install this module without installing the entire Number::Phone package, which is quite large. If you merely need to format E.123 phone numbers as raw national digits, and you don't want to install the entirety of Number::Phone, then this is the module for you. Otherwise you should probably just stick with Number::Phone::Formatter::Raw.

This module can be used with Number::Phone, or, as a standalone module.



This is the only method. It takes an E.123 international format string as its only argument and reformats it as the national portion of the number with all non-digits removed. For example:

 +44 20 8771 2924 -> 2087712924
 +1 212 334 0611  -> 2123340611


The development version is on github at and may be cloned from git://


Please report any bugs or feature requests to or through the web interface at:


Michael Schout <>


This software is copyright (c) 2017 by Michael Schout.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.