Geo::Coder::Cache - Add cache for Geo::Coder::*
# for Geo::Coder::Yahoo use Geo::Coder::Yahoo; use Geo::Coder::Cache; my $geocoder = Geo::Coder::Cache->new(geocoder => Geo::Coder::Yahoo->new(appid => 'Your App ID')); my $location = $geocoder->geocode(location => '701 1st Ave, Sunnyvale, CA 94089'); # for Geo::Coder::Google use Geo::Coder::Google; use Geo::Coder::Cache; my $geocoder = Geo::Coder::Cache->new(geocoder => Geo::Coder::Google->new(apikey => 'Your API Key')); my $location = $geocoder->geocode(location => '1600 Amphitheatre Pkwy, Mountain View, CA 94043');
Geo::Coder::Cache is a Geo::Coder::* wrapper with local file cache implemented by Cache::FileCache.
This method constructs a new Geo::Coder::Cache object and returns it. geocoder is required, and all the other options will be passed to Cache::FileCache.
Geo::Coder::Cache
geocoder
Cache::FileCache
KEY DEFAULT ----------- -------------------- geocoder REQUIRED namespace geo-coder-cache cache_root $HOME/.cache default_expires_in 86400
Geo::Coder::Cache itself is a Cache::FileCache, so please check Cache::FileCahce for cache related methods.
Cache::FileCahce
It is the primary method of this class. It will retrive result from cache first, and return if cache hit. Otherwise it will call Geo::Coder::*->geocode and then save the result in cache.
Yen-Ming Lee, <leeym@leeym.com>
Copyright (C) 2008 by Yen-Ming Lee
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Geo::Coder::Cache, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Coder::Cache
CPAN shell
perl -MCPAN -e shell install Geo::Coder::Cache
For more information on module installation, please visit the detailed CPAN module installation guide.