26 Nov 2011 04:18:47 UTC
- Distribution: IP-QQWry
- Module version: 0.0.20
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- KwaliteeBus factor: 1
- License: perl_5
- Perl: v5.8.0
- Activity24 month
- Download (25.95KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionSUNNAVY 孙海军
- BUGS AND LIMITATIONS
- LICENCE AND COPYRIGHT
IP::QQWry - a simple interface for QQWry IP database(file).
This document describes IP::QQWry version 0.0.16
use IP::QQWry; my $qqwry = IP::QQWry->new('QQWry.Dat'); my $info = $qqwry->query('184.108.40.206'); my ( $base, $ext ) = $qqwry->query(2792334959); my $version = $qqwry->db_version; $qqwry->clear;
'QQWry.Dat' http://www.cz88.net/fox/ is an IP file database. It provides some useful infomation such as the geographical position of the host bound with some IP address, the IP's owner, etc. IP::QQWry provides a simple interface for this file database.
For more about the format of the database, take a look at this: http://lumaqq.linuxsir.org/article/qqwry_format_detail.html
Caveat: The 'QQWry.Dat' database uses gbk or big5 encoding,
IP::QQWrydoesn't do any decoding stuff, use
IP::QQWry::Decodedif you want the returned info decoded.
Accept one optional parameter for database file name. Return an object of IP::QQWry.
Set database file. Accept a IP database file path as a parameter. Return 1 for success, undef for failure.
Accept one parameter, which has to be an IPv4 address such as `220.127.116.11` or an integer like 2792334959.
In list context, it returns a list containing the base part and the extension part of infomation, respectively. The base part is usually called the country part though it doesn't refer to country all the time. The extension part is usually called the area part.
In scalar context, it returns a string which is just a catenation of the base and extension parts.
If it can't find useful information, return undef.
Caveat: the domain name as an argument is not supported any more since v0.0.12. Because a domain name could have more than one IP address bound, the previous implementation is lame and not graceful, so I decided to dump it.
return 1 if $ip is cached, 0 otherwise
return database version.
No bugs have been reported.
Copyright (c) 2006-2011, sunnavy
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.