| 1 | package Number::Phone::Formatter::NationallyPreferredIntl; | ||
| 2 | |||
| 3 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 3 | ▶ | use parent 'Number::Phone::Formatter'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 3 | ▶ | use Scalar::Util qw(reftype); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 3 | our $VERSION = '1.0'; | |
| 9 | |||
| 10 | 8 | ▶ | sub format { |
|
Subroutine
format: called CC=1 SCAR=0.0
Pod
documented
| |||
| 11 | 8 | my ($class, $number, $object) = @_; | |
| 12 | |||
| 13 | 8 | $class->_format($object, 0); | |
| 14 | } | ||
| 15 | |||
| 16 | 3 | 1; | |
| 17 | |||
| 18 | =head1 NAME | ||
| 19 | |||
| 20 | Number::Phone::Formatter::NationallyPreferredIntl - nationally-preferred format for international phone number | ||
| 21 | |||
| 22 | =head1 DESCRIPTION | ||
| 23 | |||
| 24 | A formatter to output the international number in its nationally preferred format. | ||
| 25 | |||
| 26 | =head1 METHOD | ||
| 27 | |||
| 28 | =head2 format | ||
| 29 | |||
| 30 | This is the only method. It takes an E.123 international format string and a Number::Phone object, | ||
| 31 | and outputs the nationally-preferred international representation of the phone number. | ||
| 32 | |||
| 33 | +1 212 334 0611 -> +1 212-334-0611 | ||
| 34 | |||
| 35 | Note that this uses data derived from libphonenumber, and if your object is | ||
| 36 | not derived from that it will first create a temporary object. This may | ||
| 37 | involve a small unexpected performance hit. | ||
| 38 | |||
| 39 | =head1 AUTHOR, COPYRIGHT and LICENCE | ||
| 40 | |||
| 41 | Copyright 2018 Matthew Somerville E<lt>F<matthew-github@dracos.co.uk>E<gt> | ||
| 42 | |||
| 43 | This software is free-as-in-speech software, and may be used, | ||
| 44 | distributed, and modified under the terms of either the GNU | ||
| 45 | General Public Licence version 2 or the Artistic Licence. It's | ||
| 46 | up to you which one you use. The full text of the licences can | ||
| 47 | be found in the files GPL2.txt and ARTISTIC.txt, respectively. | ||
| 48 | |||
| 49 | =cut | ||