DrHyde / perl-modules-Number-Phone

Number::Phone and friends
24 stars 31 forks source link

Unexpected error #63

Closed KES777 closed 6 years ago

KES777 commented 7 years ago
$x= Number::Phone->new( '+380619265745' )
Number::Phone::StubCountry::UA=HASH(0x20d0b50)

$x->format_using( 'Raw' )
ERROR: Can't locate object method "from" via package "Number::Phone::FR::Full" (perhaps you forgot to load "Number::Phone::FR::Full"?) at (eval 24)[local/lib/perl5/Devel/DebugHooks.pm:753] line 1, <STDIN> line 15.

$x
Number::Phone::StubCountry::UA=HASH(0x20d0b50)

As you can see this is ::UA phone, but why there is error from ::FR::Full package? It is unexpected

Expect: "Number::Phone::UA"

dracos commented 6 years ago

This library doesn't have a Number::Phone::FR::Full package, so it'd be good to know what else you have installed and the code preceding the code you quote. Your code works fine for me:

§ perl -Ilib -e'use Number::Phone; $x= Number::Phone->new( "+380619265745" ); print $x->format_using("Raw");'
619265745
KES777 commented 6 years ago

Why do I need Number::Phone::FR::Full France? This is Ukraine phone and object is UA:

Number::Phone::StubCountry::UA=HASH(0x20d0b50)
dracos commented 6 years ago

I don't know, but your error message says you have it installed. It is not installed by this package. I can't help you with that, there's not enough information as to what you have done/installed/run. As I said, your code works fine here.

KES777 commented 6 years ago

I have cpanfile.snapshot and can reinstall modules to show install log. Will it help?

dracos commented 6 years ago

The steps you have taken from scratch to install modules and the code you have run to produce the error you give would be helpful in order that someone else can try and reproduce it. As it is, you have not provided enough information to go on. For example, here is what I have just done to run things starting from nothing, and get no error:

§ git clone https://github.com/DrHyde/perl-modules-Number-Phone
Cloning into 'perl-modules-Number-Phone'...
remote: Counting objects: 3382, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 3382 (delta 8), reused 16 (delta 6), pack-reused 3355
Receiving objects: 100% (3382/3382), 31.42 MiB | 747.00 KiB/s, done.
Resolving deltas: 100% (1997/1997), done.
§ cd perl-modules-Number-Phone/
§ cpanm -l local --quiet --notest XML::XPath DBM::Deep Digest::MD5 File::Find::Rule Spreadsheet::ParseExcel Text::CSV_XS
Constants from lexical variables potentially modified elsewhere are deprecated at /loader/0x7ff913803410/aliased.pm line 1.
Successfully installed Path-Tiny-0.104
Successfully installed Scalar-List-Utils-1.49 (upgraded from 1.42_02)
Successfully installed Encode-Locale-1.05
Successfully installed HTTP-Date-6.02
Successfully installed IO-HTML-1.001
Successfully installed LWP-MediaTypes-6.02
Successfully installed URI-1.72
Successfully installed HTTP-Message-6.13
Successfully installed HTTP-Cookies-6.04
Successfully installed Try-Tiny-0.28
Successfully installed WWW-RobotRules-6.02
Successfully installed HTTP-Daemon-6.01
Successfully installed HTML-Tagset-3.20
Successfully installed HTML-Parser-3.72
Successfully installed HTTP-Negotiate-6.01
Successfully installed Net-HTTP-6.17
Successfully installed File-Listing-6.04
Successfully installed libwww-perl-6.27
Successfully installed XML-Parser-2.44
Successfully installed XML-XPath-1.42
Successfully installed Module-Build-0.4224
Successfully installed Test-Deep-1.127
Successfully installed Sub-Uplevel-0.2800
Successfully installed Test-Warn-0.32
Successfully installed Test-Exception-0.43
Successfully installed DBM-Deep-2.0014
Successfully installed Digest-MD5-2.55 (upgraded from 2.54)
Successfully installed Text-Glob-0.11
Successfully installed Number-Compare-0.03
Successfully installed File-Find-Rule-0.34
Successfully installed IO-stringy-2.111
Successfully installed Digest-Perl-MD5-1.9
Successfully installed OLE-Storage_Lite-0.19
Successfully installed Crypt-RC4-2.02
Successfully installed Spreadsheet-ParseExcel-0.65
Successfully installed Text-CSV_XS-1.32
36 distributions installed
§ PERL5LIB=local/lib/perl5 ./build-data.sh 
rebuilding share/Number-Phone-UK-Data.db
Working on sabc.txt
Working on S3.xls
Working on S5.xls
Working on S7.xls
Working on S8.xls
Working on S9.xls
Working on sabcde11_12.xls
Working on sabcde13.xls
Working on sabcde14.xls
Working on sabcde15.xls
Working on sabcde16.xls
Working on sabcde17.xls
Working on sabcde18.xls
Working on sabcde19.xls
Working on sabcde2.xls
Building telco/length data ...
Creating DBM::Deep file ...
./build-data.sh: line 71: cd: libphonenumber: No such file or directory
Checking out libphonenumber ...
Cloning into 'libphonenumber'...
remote: Counting objects: 34240, done.
remote: Compressing objects: 100% (112/112), done.
remote: Total 34240 (delta 38), reused 59 (delta 10), pack-reused 34097
Receiving objects: 100% (34240/34240), 77.48 MiB | 712.00 KiB/s, done.
Resolving deltas: 100% (18770/18770), done.
rebuilding lib/Number/Phone/NANP/Data.pm
AG: good data to tell what's fixed/mobile
AI: good data to tell what's fixed/mobile
AS: good data to tell what's fixed/mobile
BB: good data to tell what's fixed/mobile
BM: good data to tell what's fixed/mobile
BS: good data to tell what's fixed/mobile
CA: same regexes for fixed and mobile
DM: good data to tell what's fixed/mobile
DO: Overlap between fixed/mobile regexes for 8092003333; can't be trusted
GD: good data to tell what's fixed/mobile
GU: same regexes for fixed and mobile
JM: Overlap between fixed/mobile regexes for 8765233333; can't be trusted
KN: good data to tell what's fixed/mobile
KY: good data to tell what's fixed/mobile
LC: good data to tell what's fixed/mobile
MP: same regexes for fixed and mobile
MS: good data to tell what's fixed/mobile
PR: same regexes for fixed and mobile
SX: good data to tell what's fixed/mobile
TC: good data to tell what's fixed/mobile
TT: good data to tell what's fixed/mobile
US: same regexes for fixed and mobile
VC: good data to tell what's fixed/mobile
VG: good data to tell what's fixed/mobile
VI: same regexes for fixed and mobile
rebuilding lib/Number/Phone/StubCountry/*.pm
skipping 'country' 001 (+800)
skipping 'country' 001 (+808)
skipping 'country' 001 (+870)
skipping 'country' 001 (+878)
skipping 'country' 001 (+881)
skipping 'country' 001 (+882)
skipping 'country' 001 (+883)
skipping 'country' 001 (+888)
skipping 'country' 001 (+979)
rebuilding t/example-phone-numbers.t
checking AG number +1 2684601234, as is_geographic *or* is_fixed_line
checking AG number +1 2684641234, as is_geographic *or* is_mobile
checking AI number +1 2644612345, as is_geographic *or* is_fixed_line
checking AI number +1 2642351234, as is_geographic *or* is_mobile
checking AS number +1 6846221234, as is_geographic *or* is_fixed_line
checking AS number +1 6847331234, as is_geographic *or* is_mobile
checking BB number +1 2464123456, as is_geographic *or* is_fixed_line
checking BB number +1 2462501234, as is_geographic *or* is_mobile
checking BM number +1 4412345678, as is_geographic *or* is_fixed_line
checking BM number +1 4413701234, as is_geographic *or* is_mobile
checking BS number +1 2423456789, as is_geographic *or* is_fixed_line
checking BS number +1 2423591234, as is_geographic *or* is_mobile
checking CA number +1 2042345678, as is_geographic *or* is_fixed_line
checking CA number +1 2042345678, as is_geographic *or* is_mobile
checking DM number +1 7674201234, as is_geographic *or* is_fixed_line
checking DM number +1 7672251234, as is_geographic *or* is_mobile
checking DO number +1 8092345678, as is_geographic *or* is_fixed_line
checking DO number +1 8092345678, as is_geographic *or* is_mobile
checking GB number +44 1212345678, as is_geographic, not is_fixed_line
checking GB number +44 1212345678, as is_geographic, not is_fixed_line
checking GB number +44 1212345678, as is_geographic, not is_fixed_line
checking GB number +44 1212345678, as is_geographic, not is_fixed_line
checking GB number +44 1212345678, as is_geographic, not is_fixed_line
checking GD number +1 4732691234, as is_geographic *or* is_fixed_line
checking GD number +1 4734031234, as is_geographic *or* is_mobile
checking GG number +44 1481256789, as is_geographic, not is_fixed_line
checking GG number +44 1481256789, as is_geographic, not is_fixed_line
checking GG number +44 1481256789, as is_geographic, not is_fixed_line
checking GU number +1 6713001234, as is_geographic *or* is_fixed_line
checking GU number +1 6713001234, as is_geographic *or* is_mobile
checking IM number +44 1624756789, as is_geographic, not is_fixed_line
checking IM number +44 1624756789, as is_geographic, not is_fixed_line
checking IM number +44 1624756789, as is_geographic, not is_fixed_line
checking JM number +1 8765123456, as is_geographic *or* is_fixed_line
checking JM number +1 8762101234, as is_geographic *or* is_mobile
checking KN number +1 8692361234, as is_geographic *or* is_fixed_line
checking KN number +1 8697652917, as is_geographic *or* is_mobile
checking KY number +1 3452221234, as is_geographic *or* is_fixed_line
checking KY number +1 3453231234, as is_geographic *or* is_mobile
checking LC number +1 7584305678, as is_geographic *or* is_fixed_line
checking LC number +1 7582845678, as is_geographic *or* is_mobile
checking MP number +1 6702345678, as is_geographic *or* is_fixed_line
checking MP number +1 6702345678, as is_geographic *or* is_mobile
checking MS number +1 6644912345, as is_geographic *or* is_fixed_line
checking MS number +1 6644923456, as is_geographic *or* is_mobile
checking PR number +1 7872345678, as is_geographic *or* is_fixed_line
checking PR number +1 7872345678, as is_geographic *or* is_mobile
checking SX number +1 7215425678, as is_geographic *or* is_fixed_line
checking SX number +1 7215205678, as is_geographic *or* is_mobile
checking TC number +1 6497121234, as is_geographic *or* is_fixed_line
checking TC number +1 6492311234, as is_geographic *or* is_mobile
checking TT number +1 8682211234, as is_geographic *or* is_fixed_line
checking TT number +1 8682911234, as is_geographic *or* is_mobile
checking US number +1 2015550123, as is_geographic *or* is_fixed_line
checking US number +1 2015550123, as is_geographic *or* is_mobile
VA number +39 0669812345 in libphonenumber's example data needs to be treated as IT at build-tests.pl line 144.
VA number +39 3123456789 in libphonenumber's example data needs to be treated as IT at build-tests.pl line 144.
VA number +39 800123456 in libphonenumber's example data needs to be treated as IT at build-tests.pl line 144.
VA number +39 899123456 in libphonenumber's example data needs to be treated as IT at build-tests.pl line 144.
VA number +39 848123456 in libphonenumber's example data needs to be treated as IT at build-tests.pl line 144.
VA number +39 1781234567 in libphonenumber's example data needs to be treated as IT at build-tests.pl line 144.
VA number +39 5512345678 in libphonenumber's example data needs to be treated as IT at build-tests.pl line 144.
checking VC number +1 7842661234, as is_geographic *or* is_fixed_line
checking VC number +1 7844301234, as is_geographic *or* is_mobile
checking VG number +1 2842291234, as is_geographic *or* is_fixed_line
checking VG number +1 2843001234, as is_geographic *or* is_mobile
checking VI number +1 3406421234, as is_geographic *or* is_fixed_line
checking VI number +1 3406421234, as is_geographic *or* is_mobile
§ perl -Ilib -E'
> use Number::Phone;
> my $x = Number::Phone->new( "+380619265745" );
> say $x->format_using("Raw");
> '
619265745
DrHyde commented 6 years ago

Can't reproduce. Please re-open it if you can reproduce this using the current version.