N {
# look for JSON::XS, and if not available, fall
# back to JSON::PP to avoid requiring non-core modules
my $json_ok = eval {
require JSON::XS;
JSON::XS->import;
1;
};
if (! $json_ok){
require JSON::PP;
JSON::PP->import;
}
}
sub new {
my ($class, %args) = @_;
my $self = bless {}, $class;
$self->_file($args{file});
_json_data;
if ($self->_file){
my $fname = $self->_file;
open my $fh, '<', $fname or croak "can't open file '$fname': $!";
{
local $/;
$gps_json_