Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Installing Module on Remote Host

Reply
Thread Tools

Installing Module on Remote Host

 
 
Mike
Guest
Posts: n/a
 
      10-27-2003
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
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      10-27-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (Mike) wrote:
> 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

--
Joy and Woe are woven fine,
A Clothing for the Soul divine William Blake
Under every grief and pine 'Auguries of Innocence'
Runs a joy with silken twine. (E-Mail Removed)
 
Reply With Quote
 
 
 
 
Mike
Guest
Posts: n/a
 
      10-27-2003
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
 
Reply With Quote
 
Matthew Braid
Guest
Posts: n/a
 
      10-27-2003
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

 
Reply With Quote
 
Matthew Braid
Guest
Posts: n/a
 
      10-27-2003
Matthew Braid wrote:

> 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
>

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

 
Reply With Quote
 
Tintin
Guest
Posts: n/a
 
      10-27-2003

"Matthew Braid" <(E-Mail Removed)> wrote in message
news:bnicq8$c65$(E-Mail Removed)...
> 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.


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




 
Reply With Quote
 
Sam Holden
Guest
Posts: n/a
 
      10-27-2003
On Mon, 27 Oct 2003 20:05:05 +1300, Tintin <(E-Mail Removed)> wrote:
>
> "Matthew Braid" <(E-Mail Removed)> wrote in message
> news:bnicq8$c65$(E-Mail Removed)...
>> 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.

>
> 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.

--
Sam Holden
 
Reply With Quote
 
Tintin
Guest
Posts: n/a
 
      10-27-2003

"Sam Holden" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed). ..
> On Mon, 27 Oct 2003 20:05:05 +1300, Tintin <(E-Mail Removed)> wrote:
> >
> > "Matthew Braid" <(E-Mail Removed)> wrote in message
> > news:bnicq8$c65$(E-Mail Removed)...
> >> 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.

> >
> > 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.


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.


 
Reply With Quote
 
Sam Holden
Guest
Posts: n/a
 
      10-27-2003
On Mon, 27 Oct 2003 21:16:06 +1300, Tintin <(E-Mail Removed)> wrote:
>
> "Sam Holden" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed). ..
>> On Mon, 27 Oct 2003 20:05:05 +1300, Tintin <(E-Mail Removed)> wrote:
>> >
>> > "Matthew Braid" <(E-Mail Removed)> wrote in message
>> > news:bnicq8$c65$(E-Mail Removed)...
>> >> 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.
>> >
>> > 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.

>
> 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).

--
Sam Holden
 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      10-27-2003
>> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dane Cook: Great S.N.L. host or GREATEST S.N.L. host? Jojo the 90lb hottie Digital Photography 1 02-14-2007 04:55 AM
Cisco PIX 501 - Port forwarded to an internal host via Static NAT doesn't work from internal host JoelSeph Cisco 9 01-23-2006 03:52 PM
Remote Assistance fails to connect, remote remote host name could not be resolved Peter Sale Wireless Networking 1 12-11-2004 09:09 PM
PIX: how to allow 1 host from outside interface to access another host on the inside interface? jonnah Cisco 1 04-21-2004 02:26 PM
request.getHeader("Host") returns wrong host name Orpheus66 Java 0 07-30-2003 02:59 PM



Advertisments