代码
use Geo::IP;
my $gi = Geo::IP->open("/opt/www/my/cgi-bin/GeoLiteCity.dat", GEOIP_STANDARD);
my $r = $gi->record_by_name("123.125.50.22");
print $record->country_code,
$record->country_code3,
$record->country_name,
$record->region,
$record->region_name,
$record->city,
$record->postal_code,
$record->latitude,
$record->longitude;
错误提示:
Can't call method "country_code" on an undefined value at getcity.pl line 18.
--
…………………………………………
Ericzhao
Email: Ericzhao82@gmail.com
MSN: Ericzhao_82@hotmail.com
BLOG: share82.freebsder.info
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---
没有评论:
发表评论