blib/lib/Number/Phone/Formatter/MSISDN.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 19 / 19 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Number/Phone/Data.pm ↑ Summary blib/lib/Number/Phone/Formatter/National.pm »
1 package Number::Phone::Formatter::MSISDN;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use parent 'Number::Phone::Formatter';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 our $VERSION = '1.0';
8  
9 121 ▶sub format {
Subroutine format: called CC=1 SCAR=0.0
Pod documented
10 121 my ( $class, $number, $object ) = @_;
11  
12 121 $object = $class->_npl_object($object);
13  
14 121 return $object->country_code . $object->{number};
15 }
16  
17 6 1;
18  
19 =head1 NAME
20  
21 Number::Phone::Formatter::MSISDN - formatter for MSISDN-formatted phone number
22  
23 =head1 DESCRIPTION
24  
25 A formatter to output the number in MSISDN format.
26 L<https://en.wikipedia.org/wiki/MSISDN>
27  
28 =head1 METHOD
29  
30 =head2 format
31  
32 This is the only method. It takes an E.123 international format string and a Number::Phone object,
33 and outputs the MSISDN-formatted number.
34  
35 +1 212 334 0611 -> 12123340611
36  
37 Note that this uses data derived from libphonenumber, and if your object is
38 not derived from that it will first create a temporary object. This may
39 involve a small unexpected performance hit.
40  
41 =head1 AUTHOR, COPYRIGHT and LICENCE
42  
43 Copyright 2026 Mario Paumann E<lt>F<mario.paumann@gmail.com>E<gt>
44  
45 This software is free-as-in-speech software, and may be used,
46 distributed, and modified under the terms of either the GNU
47 General Public Licence version 2 or the Artistic Licence. It's
48 up to you which one you use. The full text of the licences can
49 be found in the files GPL2.txt and ARTISTIC.txt, respectively.
50  
51 =cut
« blib/lib/Number/Phone/Data.pm ↑ Summary blib/lib/Number/Phone/Formatter/National.pm »