| 1 | package Locale::Country::Geo; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 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 | 2 | 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<scripts/reload.pl>. | ||||||||||
| 27 | |||||||||||
| 28 | =cut | ||||||||||
| 29 | |||||||||||
| 30 | 2 | ▶ | use Carp (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 31 | 2 | ▶ | use YAML::Syck (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 32 | 2 | my $DATA; | |||||||||
| 33 | { | ||||||||||
| 34 | 2 | local $/; | |||||||||
| 35 | 2 | $DATA = YAML::Syck::Load(<DATA>); | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | =head1 METHODS | ||||||||||
| 39 | |||||||||||
| 40 | =head2 geolocation | ||||||||||
| 41 | |||||||||||
| 42 | =cut | ||||||||||
| 43 | |||||||||||
| 44 | 0 | ▶ | sub geolocation { | ||||||||
|
Subroutine
geolocation: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 45 | 0 | my $class = shift; | |||||||||
| 46 | 0 | my $code = shift; | |||||||||
| 47 | |||||||||||
| 48 | Carp::croak "Unknown country code: $code" | ||||||||||
| 49 | 0 | ▶ | unless exists $DATA->{$code}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | |||||||||||
| 51 | 0 | return @{$DATA->{$code}}; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | =head1 AUTHOR | ||||||||||
| 55 | |||||||||||
| 56 | clkao, C<< <clkao at clkao.org> >> | ||||||||||
| 57 | |||||||||||
| 58 | =head1 BUGS | ||||||||||
| 59 | |||||||||||
| 60 | Please report any bugs or feature requests to | ||||||||||
| 61 | C<bug-locale-country-geo at rt.cpan.org>, or through the web interface at | ||||||||||
| 62 | L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Locale-Country-Geo>. | ||||||||||
| 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<http://annocpan.org/dist/Locale-Country-Geo> | ||||||||||
| 79 | |||||||||||
| 80 | =item * CPAN Ratings | ||||||||||
| 81 | |||||||||||
| 82 | L<http://cpanratings.perl.org/d/Locale-Country-Geo> | ||||||||||
| 83 | |||||||||||
| 84 | =item * RT: CPAN's request tracker | ||||||||||
| 85 | |||||||||||
| 86 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Locale-Country-Geo> | ||||||||||
| 87 | |||||||||||
| 88 | =item * Search CPAN | ||||||||||
| 89 | |||||||||||
| 90 | L<http://search.cpan.org/dist/Locale-Country-Geo> | ||||||||||
| 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 | 2 | 1; # End of Locale::Country::Geo | |||||||||
| 106 | __DATA__ | ||||||||||