Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 2015
Status: resolved
Priority: 0/
Queue: Geo-IP

People
Owner: Nobody in particular
Requestors: LGODDARD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.12
Fixed in: (no value)



Subject: Records do ont contain valid data
The following should say it all: #! perl use Geo::IP; warn "Version: $Geo::IP::VERSION"; my $address = "leegoddard.com"; my $gi = Geo::IP->new(GEOIP_STANDARD); warn "Country by address: ", $gi->country_name_by_name($address); my $record = $gi->record_by_name( $address); warn $record; warn "Country:", $record->country_name, # Cleveryly the output of the last changes depending upon # the content of the calling file. # Bug or feature? __END__ Output follows: Version: 1.12 at C:\test.pl line 2. Country by address: United Kingdom at C:\test.pl line 6. Geo::IP::Record=SCALAR(0x15d547c) at C:\test.pl line 9. Country:French Guiana at C:\test.pl line 11. Tool completed successfully
From: prasad
has this bug been fixed? [guest - Fri Jan 31 18:42:56 2003]: Show quoted text
> The following should say it all: > > #! perl > use Geo::IP; > warn "Version: $Geo::IP::VERSION"; > my $address = "leegoddard.com"; > my $gi = Geo::IP->new(GEOIP_STANDARD); > > warn "Country by address: ", $gi->country_name_by_name($address); > > my $record = $gi->record_by_name( $address); > warn $record; > > warn "Country:", $record->country_name, > > # Cleveryly the output of the last changes depending upon > # the content of the calling file. > # Bug or feature? > > __END__ > > Output follows: > > Version: 1.12 at C:\test.pl line 2. > Country by address: United Kingdom at C:\test.pl line 6. > Geo::IP::Record=SCALAR(0x15d547c) at C:\test.pl line 9. > Country:French Guiana at C:\test.pl line 11. > > Tool completed successfully
The APIs for the GeoIP Country and GeoIP City databases are different. You cannot use the record_by_name method on a GeoIP Country database. The latest version of the C API (which the Perl API wraps) should throw an error if you try to use record_by_name on a country database.