| 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 | 2 | $Number::Phone::Formatter::NationalDigits::VERSION = '0.01'; | |
| 12 | # ABSTRACT: A L<Number::Phone> formatter for the national digits only. | ||
| 13 | |||
| 14 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | |||
| 18 | 7 | ▶ | sub format { |
|
Subroutine
format: called CC=1 SCAR=0.0
Pod
documented
| |||
| 19 | 7 | my ($self, $number) = @_; | |
| 20 | |||
| 21 | 7 | $number =~ s/^.*?\s//; | |
| 22 | 7 | $number =~ s/[^0-9]+//g; | |
| 23 | |||
| 24 | 7 | return $number; | |
| 25 | } | ||
| 26 | |||
| 27 | 2 | 1; | |
| 28 | |||
| 29 | __END__ | ||