line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Locale::Country::Geo; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
37240
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
61
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Locale::Country::Geo - Module for country geographic location data |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.01 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Locale::Country::Geo; |
21
|
|
|
|
|
|
|
my ($lat, $lon) = Locale::Country::Geo->geolocation('tw'); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
The information are from google's geocoding service. You can obtain |
26
|
|
|
|
|
|
|
the data by running F. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
1
|
|
5
|
use Carp (); |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
15
|
|
31
|
1
|
|
|
1
|
|
1232
|
use YAML::Syck (); |
|
1
|
|
|
|
|
2736
|
|
|
1
|
|
|
|
|
203
|
|
32
|
|
|
|
|
|
|
my $DATA; |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
local $/; |
35
|
|
|
|
|
|
|
$DATA = YAML::Syck::Load(); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 METHODS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 geolocation |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub geolocation { |
45
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
46
|
0
|
|
|
|
|
|
my $code = shift; |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
Carp::croak "Unknown country code: $code" |
49
|
|
|
|
|
|
|
unless exists $DATA->{$code}; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
return @{$DATA->{$code}}; |
|
0
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 AUTHOR |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
clkao, C<< >> |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 BUGS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
61
|
|
|
|
|
|
|
C, or through the web interface at |
62
|
|
|
|
|
|
|
L. |
63
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
64
|
|
|
|
|
|
|
your bug as I make changes. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SUPPORT |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
perldoc Locale::Country::Geo |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
You can also look for information at: |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=over 4 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
L |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * CPAN Ratings |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
L |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
L |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item * Search CPAN |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
L |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=back |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Copyright 2007 clkao, all rights reserved. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
101
|
|
|
|
|
|
|
under the same terms as Perl itself. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
1; # End of Locale::Country::Geo |
106
|
|
|
|
|
|
|
__DATA__ |