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-12 17:35:40
|
Hi again,
I have a problem with the C API.
I installed the C API and apparently the installation is ok.
Afterwards I try to instal Geo::IP following the INSTALL file:
And i have the following error while executing $>make:
[rcuevas@localhost Geo-IP-1.35]$ sudo perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for Geo::IP
[rcuevas@localhost Geo-IP-1.35]$ sudo make
cp lib/Geo/Mirror.pm blib/lib/Geo/Mirror.pm
cp lib/Geo/IP/Record.pod blib/lib/Geo/IP/Record.pod
cp lib/Geo/IP/Record.pm blib/lib/Geo/IP/Record.pm
cp lib/Geo/IP.pm blib/lib/Geo/IP.pm
make: *** There is no rule to build
`/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE/EXTERN.h', needed for
`IP.o'. Stop.
However, if I install the PurePerl (perl Makefile.PL PP=1 ) everything works
fine.
Could you or anyone help me.
Thanks in advance,
Rubén.
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
>
>
>
>
>
|