Skip Menu |

This queue is for tickets about the Net-Whois-IP CPAN distribution.

Report information
The Basics
Id: 59483
Status: open
Priority: 0/
Queue: Net-Whois-IP

People
Owner: Nobody in particular
Requestors: njh [...] bandsman.co.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.04
Fixed in: (no value)



Subject: Gives wrong results
print "Country: " . Net::Whois::IP::whoisip_query(212.159.106.41)->{'Country'} . "\n"; Prints nl, it should print gb. Try "whois 212.159.106.41" for the correct results.
Subject: Re: [rt.cpan.org #59483] AutoReply: Gives wrong results
Date: Sat, 17 Jul 2010 18:42:55 +0100
To: bug-Net-Whois-IP [...] rt.cpan.org
From: Nigel Horne <njh [...] bandsman.co.uk>
By the way Net::Whois::IANA get's it right. -Nigel
From: support [...] bettercgi.com
On Sat Jul 17 13:41:44 2010, njh@bandsman.co.uk wrote: Show quoted text
> print "Country: " . > Net::Whois::IP::whoisip_query(212.159.106.41)->{'Country'} . "\n"; > > Prints nl, it should print gb. Try "whois 212.159.106.41" for the > correct results.
This is easily fixed. It gives wrong results for RIPE IPs since RIPE changed the format of their replies, replacing OrgID with OrgId. To fix, add an "i" to line #149, changing this: }elsif((/OrgID:\s+(\S+)/) || to: }elsif((/OrgID:\s+(\S+)/i) || Here is a complete patch to be used with software such as "patch": diff -rup Net-Whois-IP-1.04/Changes fixed/Changes --- Net-Whois-IP-1.04/Changes 2007-01-18 03:34:59.000000000 -0600 +++ fixed/Changes 2010-09-02 19:23:35.853606505 -0500 @@ -15,3 +15,10 @@ Revision history for Perl extension Net: records 1.00 Tue Dec 6 12:55:22 2005 -no bug reports for a year... ready for release + +1.04 Changes made not documented here + +1.05 Thu Sep 2 19:22:00 2010 + -made check for OrgID not case sensitive due to server format changes. + Ray Morris <support@bettercgi.com> + diff -rup Net-Whois-IP-1.04/IP.pm fixed/IP.pm --- Net-Whois-IP-1.04/IP.pm 2007-03-07 10:49:36.000000000 -0600 +++ fixed/IP.pm 2010-09-02 19:20:39.151606217 -0500 @@ -146,7 +146,7 @@ sub _do_processing { #DO_DEBUG("Contact -- registrar = $registrar -- trying again"); last LOOP; - }elsif((/OrgID:\s+(\S+)/) || (/source:\s+(\S+)/) && (!defined($hash_response->{$pattern1})) ) { + }elsif((/OrgID:\s+(\S+)/i) || (/source:\s+(\S+)/) && (!defined($hash_response->{$pattern1})) ) { my $val = $1; #DO_DEBUG("Orgname match: value was $val if not RIPE,APNIC,KRNIC,or LACNIC.. will skip"); if($val =~ /^(?:RIPE|APNIC|KRNIC|LACNIC|AFRINIC)$/) { [raymorris@raydesk1 /tmp]$ grep -Hin orgid fixed/IP.pm fixed/IP.pm:149: }elsif((/OrgID:\s+(\S+)/i) || (/source:\s+(\S+)/) && (!defined($hash_response->{$pattern1})) ) {
Subject: Re: [rt.cpan.org #59483] Gives wrong results
Date: Fri, 3 Sep 2010 13:30:58 -0500
To: "bug-Net-Whois-IP [...] rt.cpan.org" <bug-Net-Whois-IP [...] rt.cpan.org>
From: Ben Schmitz <ben [...] foink.com>
New version uploaded. Sorry for the delay. Ben Pardon typos; from my phone. On Sep 2, 2010, at 7:36 PM, "Ray Morris via RT" <bug-Net-Whois-IP@rt.cpan.org Show quoted text
> wrote:
Show quoted text
> Queue: Net-Whois-IP > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=59483 > > > On Sat Jul 17 13:41:44 2010, njh@bandsman.co.uk wrote:
>> print "Country: " . >> Net::Whois::IP::whoisip_query(212.159.106.41)->{'Country'} . "\n"; >> >> Prints nl, it should print gb. Try "whois 212.159.106.41" for the >> correct results.
> > This is easily fixed. It gives wrong results for RIPE IPs since RIPE > changed the format of their replies, replacing OrgID with OrgId. > > To fix, add an "i" to line #149, changing this: > }elsif((/OrgID:\s+(\S+)/) || > to: > }elsif((/OrgID:\s+(\S+)/i) || > > > Here is a complete patch to be used with software such as "patch": > > diff -rup Net-Whois-IP-1.04/Changes fixed/Changes > --- Net-Whois-IP-1.04/Changes 2007-01-18 03:34:59.000000000 -0600 > +++ fixed/Changes 2010-09-02 19:23:35.853606505 -0500 > @@ -15,3 +15,10 @@ Revision history for Perl extension Net: > records > 1.00 Tue Dec 6 12:55:22 2005 > -no bug reports for a year... ready for release > + > +1.04 Changes made not documented here > + > +1.05 Thu Sep 2 19:22:00 2010 > + -made check for OrgID not case sensitive due to server format > changes. > + Ray Morris <support@bettercgi.com> > + > diff -rup Net-Whois-IP-1.04/IP.pm fixed/IP.pm > --- Net-Whois-IP-1.04/IP.pm 2007-03-07 10:49:36.000000000 -0600 > +++ fixed/IP.pm 2010-09-02 19:20:39.151606217 -0500 > @@ -146,7 +146,7 @@ sub _do_processing { > #DO_DEBUG("Contact -- registrar = $registrar -- trying again"); > last LOOP; > > - }elsif((/OrgID:\s+(\S+)/) || (/source:\s+(\S+)/) && > (!defined($hash_response->{$pattern1})) ) { > + }elsif((/OrgID:\s+(\S+)/i) || (/source:\s+(\S+)/) && > (!defined($hash_response->{$pattern1})) ) { > my $val = $1; > #DO_DEBUG("Orgname match: value was $val if not RIPE,APNIC,KRNIC,or > LACNIC.. will skip"); > if($val =~ /^(?:RIPE|APNIC|KRNIC|LACNIC|AFRINIC)$/) { > [raymorris@raydesk1 /tmp]$ grep -Hin orgid fixed/IP.pm > fixed/IP.pm:149: }elsif((/OrgID:\s+(\S+)/i) || (/source:\s+(\S > +)/) && > (!defined($hash_response->{$pattern1})) ) { > >
From: njh [...] bandsman.co.uk
Thanks for the update. However when I try with this I get: Use of uninitialized value $multiple_flag in concatenation (.) or string at /usr/local/share/perl/5.10.1/Net/Whois/IP.pm line 110 (#1) And the return value is "undef".
Subject: Re: [rt.cpan.org #59483] Gives wrong results
Date: Mon, 06 Sep 2010 08:50:05 -0500
To: bug-Net-Whois-IP [...] rt.cpan.org
From: Ben Schmitz <ben [...] foink.com>
Can you tell me what version you are using as well as an example ip? Thanks Ben On 9/6/10 8:16 AM, njh@bandsman.co.uk via RT wrote: Show quoted text
> Queue: Net-Whois-IP > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=59483> > > Thanks for the update. However when I try with this I get: > > Use of uninitialized value $multiple_flag in concatenation (.) or string at > /usr/local/share/perl/5.10.1/Net/Whois/IP.pm line 110 (#1) > > And the return value is "undef".
From: njh [...] bandsman.co.uk
I am using 1.06 and the IP address is 212.159.106.41.
Subject: Re: [rt.cpan.org #59483] Gives wrong results
Date: Tue, 07 Sep 2010 10:20:30 -0500
To: bug-Net-Whois-IP [...] rt.cpan.org
From: Ben Schmitz <ben [...] foink.com>
Here is what i see from this sample script as output; notice that i was give a 503 error; perhaps this is the source of your problem? --script-- #!/usr/local/bin/perl use Net::Whois::IP qw(whoisip_query); my $ip = $ARGV[0]; print $ip . "\n"; my $response = whoisip_query($ip); foreach ( sort keys %$response ){ print "$_ $response->{$_}\n"; } --!script-- ben@kepler:~$ perl ./foo.pl 212.159.106.41 212.159.106.41 ERROR 503 Unable to service request due to high volume. ben@kepler:~$ perl ./foo.pl 212.159.106.41 212.159.106.41 % Note This output has been filtered. abuse-mailbox abuse@plus.net address GB admin-c SB195-RIPE country GB descr PlusNet Technologies Ltd inetnum 212.159.64.0 - 212.159.127.255 mnt-by MAINT-AS6871 netname PLUSNET-DIAL-ADSL nic-hdl PLUS1-RIPE origin AS6871 person PlusNet Ripe Admin phone +44 114 22 00084 remarks ------------------------------------------------ remarks: Support 24*7 Phone (UK) 0845 140 0200 remarks: trouble abuse@plus.net role Plusnet Hostmaster route 212.159.64.0/18 source RIPE # Filtered status ASSIGNED PA tech-c AM10633-RIPE njh@bandsman.co.uk via RT wrote: Show quoted text
> Queue: Net-Whois-IP > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=59483 > > > I am using 1.06 and the IP address is 212.159.106.41.