File Coverage

blib/lib/Number/Phone/Formatter/NationalDigits.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 14 14 100.0


line stmt bran cond sub pod time code
1             #
2             # This file is part of Number-Phone-Formatter-NationalDigits
3             #
4             # This software is copyright (c) 2017 by Michael Schout.
5             #
6             # This is free software; you can redistribute it and/or modify it under
7             # the same terms as the Perl 5 programming language system itself.
8             #
9              
10             package Number::Phone::Formatter::NationalDigits;
11             $Number::Phone::Formatter::NationalDigits::VERSION = '0.01';
12             # ABSTRACT: A L formatter for the national digits only.
13              
14 2     2   368636 use strict;
  2         5  
  2         52  
15 2     2   8 use warnings;
  2         4  
  2         187  
16              
17              
18             sub format {
19 6     6 1 177150 my ($self, $number) = @_;
20              
21 6         35 $number =~ s/^.*?\s//;
22 6         39 $number =~ s/[^0-9]+//g;
23              
24 6         33 return $number;
25             }
26              
27             1;
28              
29             __END__