Installing Module on Remote Host

M

Mike

Hi all,

I've just installed the Business::UPS module on my remote host, under
/home/mysite/modules. If you're familiar with it, this module also
requires LWP::UserAgent.

I used LIB to define where the Business::UPS module was located, and
my account does come with the LWP package. But when I try to run my
program, I get this error:

Can't locate object method "get" via package "LWP::UserAgent"

Any suggestions?

TIA,

Mike
 
B

Ben Morrow

I've just installed the Business::UPS module on my remote host, under
/home/mysite/modules. If you're familiar with it, this module also
requires LWP::UserAgent.

I used LIB

I presume you mean you used a line like
use lib qw(/home/mysite/modules);
? If not, you should have.
to define where the Business::UPS module was located, and
my account does come with the LWP package.

Are you sure it works? What happens when you invoke a minimal script
that uses LWP (with the same @INC settings)?
But when I try to run my program, I get this error:

Can't locate object method "get" via package "LWP::UserAgent"

Any suggestions?

use strict;
use warnings; if you aren't already.

Post us a MINIMAL script that exhibits the problem and the full error
output so we have some chance of working out what's going on.

Ben
 
M

Mike

Hi Ben,
I presume you mean you used a line like
use lib qw(/home/mysite/modules);

Yup, exactly like that.
Are you sure it works? What happens when you invoke a minimal script
that uses LWP (with the same @INC settings)?

I have another program that uses LWP::UserAgent, and it has no
problems, so I'm sure the LWP package is working.
Post us a MINIMAL script that exhibits the problem and the full error
output so we have some chance of working out what's going on.

I am using warnings, but the only error at all is:

Can't locate object method "get" via package "LWP::UserAgent" at
/home3/mysite/modules/Business/UPS.pm line 49.
[Sun Oct 26 23:41:11 2003] [error] [client 158.253.120.193] Premature
end of script headers: /www/mysite/cgi-bin/test.cgi


The program I'm testing with is pretty much copied from the CPAN site.
It is:

#!/usr/bin/perl -w

use lib "/home3/mysite/modules";
use Business::UPS;
use strict;

my ($shipping,$ups_zone,$error) = getUPS(qw/GNDRES 23606 90210 25/);
$error and die "ERROR: $error\n";

print "Content-type: text/html\n\n";
print "The shipping is: $shipping";
exit;


TIA,

Mike
 
M

Matthew Braid

I know its probably a typo, but you never know...
use lib "/home3/mysite/modules";
^

If that '3' is in your real code things won't work.

I was going to check further into Business::UPS, but CPAN's search seems
to be broken at the moment.

MB
 
M

Matthew Braid

Matthew said:
I know its probably a typo, but you never know...


^

If that '3' is in your real code things won't work.

I was going to check further into Business::UPS, but CPAN's search seems
to be broken at the moment.

MB
And of course by "won't work" I mean "won't work if your previous post
was accurate and the libdir is actually /home/mysite/modules"

:)

MB
 
T

Tintin

Matthew Braid said:
I know its probably a typo, but you never know...

^

If that '3' is in your real code things won't work.

What logic are you using to deduce that? That seems like a perfectly normal
path.
 
S

Sam Holden

What logic are you using to deduce that? That seems like a perfectly normal
path.

The fact that the original post stated:

I've just installed the Business::UPS module on my remote host,
under /home/mysite/modules

seems like pretty good logic to me.
 
T

Tintin

Sam Holden said:
The fact that the original post stated:

I've just installed the Business::UPS module on my remote host,
under /home/mysite/modules

seems like pretty good logic to me.

Except that the chances of that being a real path is extremely low. I'll
admit that the OP should have been more specific in the *actual* path being
used to save the confusion.
 
S

Sam Holden

Except that the chances of that being a real path is extremely low. I'll
admit that the OP should have been more specific in the *actual* path being
used to save the confusion.

Way off topic now...

But I can't understand why you would say '/home/mysite/modules' has an
"extremely low" change of being a real path, while '/home3/mysite/modules'
looks "like a perfectly normal path".

Linux seems a popular choice for web hosting providers. All the linux
distributions I use default to /home/login for home directories. Having
the login be the site name seems a reasonable thing for a hosting
provider to do, and would result in the first path.

The second path would indicate multiple disks, with home directories
scattered amongst them. That's also a common enough technique, but the
*vast* majority of hosting providers use cheap linux dedicated servers
at places like rackshack, which don't usually have multiple drives (and
almost never more than 2).

The perl modules I've installed on my el-cheapo hosting provider are
installed under /home/sholden/perl, which is pretty close to the
original path. My choice of login name is unusual, since looking at the
server configs *every* other login is an 8 character version of the site
name (except for one other, which is one I created).
 
M

Mike

use lib "/home3/mysite/modules";
If that '3' is in your real code things won't work.


My apologies for the confusion. In the original post, I was trying to
take out as much unnecessary code as possible, and while the 3 is
indeed there for my host, I had taken it out to simplify things in the
beginning (or so I thought)...

Sorry about that,

Mike
 
M

Matthew Braid

Mike said:
My apologies for the confusion. In the original post, I was trying to
take out as much unnecessary code as possible, and while the 3 is
indeed there for my host, I had taken it out to simplify things in the
beginning (or so I thought)...

Sorry about that,

Mike

As I said, I thought it was probably a typo, but it would have been a
nice quick fix if it hadn't :)

MB
 
M

Mike

As I said, I thought it was probably a typo, but it would have been a
nice quick fix if it hadn't :)


That would have been nice! :)

I think I found the problem, though. My host let's me view the modules
(I just can't edit them unless their in my directory), and when I
looked at the UserAgent.pm module, there was no "sub get," like the
program is calling. However, when I looked on CPAN, the module there
DID have this subroutine.

So, it appears that my host is either using an incomplete or outdated
copy. Turns out it's their problem, after all.

Thanks a lot for the help, guys!

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top