Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9149051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:25:29+00:00 2026-06-17T11:25:29+00:00

A Perl module exists in order to interface with the Google Maps API. The

  • 0

A Perl module exists in order to interface with the Google Maps API. The code is as follows:

 use Geo::Coder::Google;
 $geocoder = Geo::Coder::Google->new();
 @location = $geocoder->geocode(location => '1600 Pennsylvania Ave. Washington DC USA'); 

Site Source: http://search.cpan.org/~arcanez/Geo-Coder-Google-0.11/lib/Geo/Coder/Google/V2.pm

However I need to go from coordinates to address. How is that done even if that means using a different means in PERL? Please be advised that I tried the OpenMaps API and it is inaccurate. Google Maps seems to be much better.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:25:29+00:00Added an answer on June 17, 2026 at 11:25 am

    Answer:

    1. Download the CPAN Geo::Coder::Google object.
    2. Navigate your way to the V3.pm object.
    3. Drop this module into the code.

    sub reverseGeocode {my $self = shift;

    my %param;
    if (@_ % 2 == 0) {
        %param = @_;
    } else {
        $param{location} = shift;
    }
    
    
    
    my $location = $param{location} 
        or Carp::croak("Usage: reverseGeocode(location => \$location)");
    
    if (Encode::is_utf8($location)) {
        $location = Encode::encode_utf8($location);
    }
    
    my $uri = URI->new("http://$self->{host}/maps/api/geocode/json");
    my %query_parameters = (latlng => $location);
    $query_parameters{language} = $self->{language} if defined $self->{language};
    $query_parameters{region} = $self->{region} if defined $self->{region};
    $query_parameters{oe} = $self->{oe};
    $query_parameters{sensor} = $self->{sensor} ? 'true' : 'false';
    $uri->query_form(%query_parameters);
    my $url = $uri->as_string;
    
    if ($self->{client} and $self->{key}) {
        $query_parameters{client} = $self->{client};
        $uri->query_form(%query_parameters);
    
        my $signature = $self->make_signature($uri);
        # signature must be last parameter in query string or you get 403's
        $url = $uri->as_string;
        $url .= '&signature='.$signature if $signature;
    }
    

    Then just use it like this:

     my $location = $geocoder->reverseGeocode(location => '40.7837366863403,-73.9882784482727');
    

    Then you can access returning object like so:

     print $location->{formatted_address};
    

    To see the detailed parts of the address see the following link as a guide:
    https://developers.google.com/maps/documentation/geocoding/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a Perl module Galaxy::SGE::MakeJobSH with OO. I want to use MakeJobSH->new()
When writing a Perl module, is it a good practice to use croak/die inside
I am trying to use XML::RAI perl module on UTF8 coded text and I
I am currently creating a Perl module for in house use. I used ExtUtils::ModuleMaker
Possible Duplicate: What are valid Perl module return values? Generally we use 1; at
I'm trying to a good Perl module to use for connecting to a Sybase
In Perl module I have code like this: ... my $param = 123; my
I have two perl module files like : is_date_holiday.pl : use strict; use warnings;
There exists a Perl module that provides the perfect functionality for my Python app.
When building a Perl module ExtUtils::MakeMaker uses the flags defined in Config.pm (see perldoc

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.