CC: | michael.smith [...] dianomi.com,michael.stevens [...] dianomi.com |
Subject: | International code required even when country specified |
I expected this program to do something useful:
#!/usr/bin/perl -w
use strict;
use Number::Phone;
use Data::Dumper;
my $p = Number::Phone->new("us", "(212) 796-6916");
print Dumper($p->type) . "\n";
The output is:
Can't call method "type" on an undefined value at test.pl line 8.
To be more useful I needed to change it to:
#!/usr/bin/perl -w
use strict;
use Number::Phone;
use Data::Dumper;
my $p = Number::Phone->new("us", "+1 (212) 796-6916");
print Dumper($p->type) . "\n";
which gives me the more accurate output:
$VAR1 = 'is_valid';
It seems odd to need to specific the country twice.