Руслан У. Закиров > Geo-IP-RU-IpGeoBase > Geo::IP::RU::IpGeoBase



Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  


Geo::IP::RU::IpGeoBase - look up location by IP address in Russia


This module allows you to look up location in DB provided by service. Access to the DB is free. Contains information about city, region, federal district and coordinates.

DB provided as plain text files and is not very suitable for look ups without loading all data into memory. Instead it's been decided to import data into a database. Use command line utility to create and update back-end DB.

At this moment DB can be created in SQLite, mysql and Pg. If you create table manually then probably module will just work. It's very easy to add support for more back-end DBs. Patches are welcome.



Returns a new object. Takes a hash with options, mostly description of the back-end:

    Geo::IP::RU::IpGeoBase->new( db => {
        dbh => $dbh, table => 'my_table',
    } );
    # or
    Geo::IP::RU::IpGeoBase->new( db => {
        dsn => 'dbi:mysql:mydb',
        user => 'root', pass => 'secret',
        table => 'my_table',
    } );


Takes an IP in '' format and returns information about blocks that contains this IP. Yep, blocks, not a block. In theory DB may contain intersecting blocks.

Each record is a hash reference with the fields matching table columns: istart, iend, start, end, city, region, federal_district, latitude and longitude.


Ruslan Zakirov ><


Under the same terms as perl itself.

syntax highlighting: