CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
can't call method "seq" on an undefined value at C:/Perl/site/lib/Geo/Coder/US.pm

 



arai
New User

Aug 6, 2009, 12:01 PM

Post #1 of 7 (4122 views)
can't call method "seq" on an undefined value at C:/Perl/site/lib/Geo/Coder/US.pm Can't Post

I am getting the following error:
can't call method "seq" on an undefined value at C:/Perl/site/lib/Geo/Coder/US.pm

while running the following code:

#!/usr/bin/perl -w
Use Geo::Coder::US;
Geo::Coder::US->set_db("geocoder.db");
my ($stadium) = Geo::Coder::US->geocode
("411 Woody Hayes Dr, Columbus, OH");
print "The Ohio State University stadium coordinates:
Latitude ($stadium->{lat}) Longitude($stadium->{long})";

Could somebody help me with this?

Thanks


KevinR
Veteran


Aug 6, 2009, 1:47 PM

Post #2 of 7 (4119 views)
Re: [arai] can't call method "seq" on an undefined value at C:/Perl/site/lib/Geo/Coder/US.pm [In reply to] Can't Post

maybe a typo but this line:


Code
Use Geo::Coder::US;


should be:


Code
use Geo::Coder::US;



"use" should be all lower-case as all of perls builtin functions are all lower-case. Although if it were"Use" the script should report a different error.
-------------------------------------------------


arai
New User

Aug 6, 2009, 1:52 PM

Post #3 of 7 (4117 views)
Re: [KevinR] can't call method "seq" on an undefined value at C:/Perl/site/lib/Geo/Coder/US.pm [In reply to] Can't Post

Thanks for getting back. My bad. I always had "use" in lower case in my perl script. So I still need a solution.


Thanks


KevinR
Veteran


Aug 6, 2009, 1:57 PM

Post #4 of 7 (4113 views)
Re: [arai] can't call method "seq" on an undefined value at C:/Perl/site/lib/Geo/Coder/US.pm [In reply to] Can't Post

Sorry, I tried installing the module on my Strawberry perl 5.10, Vista 64 bit machine and the install failed so I can't test it.

My guess is that the set_db() argument needs to be changed to reflect where the db is on your computer/server.
-------------------------------------------------


KevinR
Veteran


Aug 6, 2009, 2:01 PM

Post #5 of 7 (4111 views)
Re: [arai] can't call method "seq" on an undefined value at C:/Perl/site/lib/Geo/Coder/US.pm [In reply to] Can't Post

I did a force install but now I get another error when I run your code:

Can't locate DB_File.pm in @INC

That's as much as I want to try. Maybe someone else have a suggestion.
-------------------------------------------------


arai
New User

Aug 6, 2009, 2:07 PM

Post #6 of 7 (4109 views)
Re: [KevinR] can't call method "seq" on an undefined value at C:/Perl/site/lib/Geo/Coder/US.pm [In reply to] Can't Post

Thanks for Trying Kevin!

For your error you will have to install the DB_file package from the perl package manager I guess.

My code is executing now but then it's not returning the latitude and longitude.

I'm getting the following output now:

The Ohio State University stadium coordinates: Latitude - Longitude -


KevinR
Veteran


Aug 6, 2009, 2:12 PM

Post #7 of 7 (4107 views)
Re: [arai] can't call method "seq" on an undefined value at C:/Perl/site/lib/Geo/Coder/US.pm [In reply to] Can't Post

I see this is the modules documentation:

Consider using a web service to access this geocoder over the Internet, rather than going to all the trouble of building a database yourself. See eg/soap-client.pl, eg/xmlrpc-client.pl, and eg/rest-client.pl for different examples of working clients for the rpc.geocoder.us geocoder web service.


Did you build the database on your computer/server?

I tried installing DB_File but it fails even when I try forcing it. I don't know why, my experience with installing modules is pretty basic. But then again, I don't have the Berkley database anyway so I would have had to use a webservice like the documentation suggests.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives