Skip to content

Instantly share code, notes, and snippets.

@hisaichi5518
Created November 26, 2011 06:21
Show Gist options
  • Save hisaichi5518/1395166 to your computer and use it in GitHub Desktop.
Save hisaichi5518/1395166 to your computer and use it in GitHub Desktop.
Data::Wheren使ってみた。
use strict;
use warnings;
use Data::Wheren::7Bit;
sub say {
print @_, "\n";
}
my $wheren = Data::Wheren::7Bit->new;
my $lat = 35.3137;
my $lon = 139.4863;
my $epoch_time = time;
my $level = 7;
my $hash = $wheren->encode( $lat, $lon, $epoch_time, $level );
($lat, $lon, $epoch_time) = $wheren->decode( $hash );
say $lat;
say $lon;
say $epoch_time;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment