Subject: | Add a get_country method to get code and name in one call |
It would be helpful if the module provided a get_country() method,
which returns a simple data object, from which you could get both
ISO country code and country name.
For example:
$gi = Geo::IP2Location->open('IP-COUNTRY.BIN');
$country = $gi->get_country($ip);
$code = $country->code;
$name = $country->name;
The Country class could be as simple as:
package Geo::IP2Location::Country;
use Mouse;
has 'code' => (is => 'r', isa => 'Str');
has 'name' => (is => 'r', isa => 'Str');
1;