Subject: | MD5-Reverse wont install - t/00-load.t fails with "Bad arg length for Socket::pack_sockaddr_in" |
Date: | Sat, 01 Mar 2014 17:00:24 -0800 |
To: | bug-Digest-MD5-Reverse [...] rt.cpan.org |
From: | Vijay <vijay [...] calmet.com> |
Running Build test
t/00-load.t ....... 1/5 # Testing Digest::MD5::Reverse 1.3, Perl
5.014002, /usr/bin/perl
Use of uninitialized value in subroutine entry at
/usr/lib/perl5/Socket.pm line 827.
Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at
/usr/lib/perl5/Socket.pm line 827.
# Looks like you planned 5 tests but ran 1.
# Looks like your test exited with 110 just after 1.
After some digging, I found this was because "ice.breaker.free.fr" was
not DNS resolvable.
I finally got it working with the following hack:
----------------------------------------------------------------------------------------
Replace line 171 with:
##connect($socket,sockaddr_in(80, inet_aton($url))) or die
"Connect Error: $!\n";
inet_aton($url) or die "inet_aton Error: $!\n\t attempting to
connect to '$url'\n";
connect($socket,pack_sockaddr_in(80, inet_aton($url))) or die
"Connect Error: $!\n\t attempting to connect to '$url'\n";
Comment out this near line 119:
# {
# host => "ice.breaker.free.fr",
# path => "/md5.php?hash=%value%",
# meth => "GET",
# mreg => qr{
# <br>\s-\s(.+?)<br>
# }x
# },
----------------------------------------------------------------------------------------
The module should really test the resolvability of the URL before trying
to connect to it, and auto-disable the URL if not resolvable.
-Vijay