Re: [Geoip-perl] How can I use the function $org = $gi->org_by_addr( $ipaddr );
Brought to you by:
tjmather
From: R. C. R. <rcu...@gm...> - 2008-11-11 17:41:06
|
Thanks Boris for your answer. I am using pure perl. However if I use $gi->org_by_name($ipaddr); I don't obtain the desired result. I think it is because I don't have a GeoIPOrg.dat but a GeoIPOrg.cvs... Could you tell me if I can create the GeoIPOrg.dat from the GeoIPOrg.cvs file I have, or should I buy a new MaxMind product. Again, thanks in advance. On Tue, Nov 11, 2008 at 2:43 PM, Boris Zentner <bze...@ma...> wrote: > Hi, > > Seems you did not install the C API and the pure perl fallback is used. > > I suggest to install the CAPI and reinstall Geo::IP afterwards. That fix > your problem. > > use Geo::IP; > my $ipaddr = '24.24.24.24'; > my $gi = Geo::IP->open('/usr/local/share/GeoIP/GeoIPOrg.dat') or die > $!; > my $org = $gi->org_by_addr($ipaddr); > print $org; > > If you feel comfortable with the PurePerl code, replace org_by_addr with > org_by_name. > org_by_name notice that you call it with a ip and does the same as > org_by_addr for that case. > > use Geo::IP; > my $ipaddr = '24.24.24.24'; > my $gi = Geo::IP->open('/usr/local/share/GeoIP/GeoIPOrg.dat') or die > $!; > my $org = $gi->org_by_name($ipaddr); > print $org; > > Sure I will add the missing method in the next release of Geo::IP. Thanks > for the hint! > > Have a nice day. > > Am 11.11.2008 um 13:25 schrieb Rubén Cuevas Rumín: > > Hi all, >> >> When try to use the function: >> >> $org = $gi->org_by_addr( $ipaddr ); >> >> I obtain as answer: >> >> Can't locate object method "org_by_addr" via package "Geo::IP" at >> ./prueba.pl line 12. >> >> Basically, I have a file with IP addresess and I want to which ISP they >> belong to. >> >> It would be great if any of you could help me. >> >> Thanks in advance, >> Rubén. >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> >> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________ >> Geoip-perl mailing list >> Geo...@li... >> https://lists.sourceforge.net/lists/listinfo/geoip-perl >> > > -- > Boris > > > > > |