Skip to content
Browse files

N::P->new comments

  • Loading branch information...
1 parent 1a1c2ca commit 1435f2bfca3634caa89cac67edbfc9ae88100390 @DrHyde DrHyde committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Number/Phone.pm
View
4 lib/Number/Phone.pm
@@ -115,14 +115,14 @@ sub new {
my $class = shift;
my($country, $number) = @_;
- if(!defined($number)) {
+ if(!defined($number)) { # one arg
$number = $country;
} elsif($country =~ /[a-z]/i) { # eg 'UK', '12345'
$number = '+'.
Number::Phone::Country::country_code($country).
$number
unless(index($number, '+'.Number::Phone::Country::country_code($country)) == 0);
- } else {
+ } else { # (+)NNN
$number = join('', grep { defined } ($country, $number));
}

0 comments on commit 1435f2b

Please sign in to comment.
Something went wrong with that request. Please try again.