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

Fellow Monks,
I've searched and can't find how to refer to Geo::Coder from a cgi script.
Error message returned is:

Can't locate Geo/Coder/US.pm

cgi script is:

#!/usr/bin/perl -w use strict; use warnings; use CGI::Carp qw(fatalsToBrowser); use Cwd; use Geo::Coder::US;

Replies are listed 'Best First'.
Re: Geo::Coder reference
by GrandFather (Saint) on Apr 16, 2012 at 04:56 UTC

    Have you installed the module using cpan or by some similar means? What OS are you using and what install of Perl (that may affect options for installing modules)?

    True laziness is hard work
Re: Geo::Coder reference
by Khen1950fx (Canon) on Apr 16, 2012 at 06:48 UTC
    Run this:
    #!/usr/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->install(qw( Test::More Pod::Man File::Spec Data::Dumper ExtUtils::MakeMaker DB_File Class::Data::Inheritable Class::Accessor Carp Carp::Assert base SDERLE/Geo-TigerLine-0.02.tar.gz Geo::Fips55 Geo::StreetAddress::US Geo::Coder::US));
    Then run this:
    #!/usr/bin/perl -l use strict; use warnings; use Geo::Coder::US; print $Geo::Coder::US::VERSION;

      Why assume root, or a configured CPAN?

      Thanks, that worked, mostly.

      I had to add one more line as a pointer to the local database after it was installed on the server, then it worked fine.

      Geo::Coder::US->set_db( "/path_to_database_on_my_server" );

      Thanks to all who replied!