kjp320 has asked for the wisdom of the Perl Monks concerning the following question:

Im very new to Perl, just started messing around with it about 3 months ago. I am working on a college senior project that requires me to take an address, geocode it(get approximate GPS location) and then send it along to a GPS device. the problem i am having is i cant/dont know how to get the program to return only the lattitude and longitude coordinates of the address. i have gotten my program to access the server and return information about the address, including the lat and long, but i want to seperate these 2 pieces of information out because they are all that i care about. Here is my code:
#!/usr/bin/perl use SOAP::Lite; use Data::Dumper; #use strict; use warnings; #use Geo::Coder::Us; my ($where) = ""\n"; my $result = SOAP::Lite -> uri( 'http://rpc.geocoder.us/Geo/Coder/US' ) -> proxy ('http://rpc.geocoder.us/service/soap' ) -> geocode_address( $where ) -> result; print Dumper $result;
i've read through the geocode examples and the Soap::Lite pages and i've tried what i have seen but nothing seems to work. so any and all help would be extremely appreciated!!!! thanks

Replies are listed 'Best First'.
Re: returning lat and long only??
by samtregar (Abbot) on Apr 01, 2008 at 22:06 UTC
    Yuck, SOAP. Why did you give up on using Geo::Coder::US directly? If you need the DB file, I've got it up here:

    http://sam.tregar.com/geocoder.html

    That will be much faster and more reliable than making SOAP calls across the internet.

    -sam

Re: returning lat and long only??
by runrig (Abbot) on Apr 01, 2008 at 23:40 UTC
    In perl module names, case matters (though in Windows it might still work if you spell it correctly later):
    #use Geo::Coder::Us; #try: use Geo::Coder::US;
Re: returning lat and long only??
by BrowserUk (Patriarch) on Apr 01, 2008 at 21:49 UTC
Re: returning lat and long only??
by GrandFather (Saint) on Apr 01, 2008 at 23:01 UTC

    You may find that learning a little more about hashes helps. Have a look at perldata.

    I notice that you have commented out use strict;. Especially when you are learning Perl (and aren't we all) you should always use strictures. Points for knowing about strict and warnings, but major points off for turning off strict (probably because it was telling you something you didn't understand).


    Perl is environmentally friendly - it saves trees
      I notice that you have commented out use strict
      I've wondered about this. Perhaps strict should be renamed to "help" and warnings to "more_help"

        ...and diagnostics might be lots_more_help, or perhaps helpful_help(?).