Installing Module on Remote Host

Discussion in 'Perl Misc' started by Mike, Oct 27, 2003.

  1. Mike

    Mike Guest

    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
     
    Mike, Oct 27, 2003
    #1
    1. Advertising

  2. Mike

    Ben Morrow Guest

    (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.
     
    Ben Morrow, Oct 27, 2003
    #2
    1. Advertising

  3. Mike

    Mike Guest

    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
     
    Mike, Oct 27, 2003
    #3
  4. 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
     
    Matthew Braid, Oct 27, 2003
    #4
  5. 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
     
    Matthew Braid, Oct 27, 2003
    #5
  6. Mike

    Tintin Guest

    "Matthew Braid" <> wrote in message
    news:bnicq8$c65$...
    > 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.
     
    Tintin, Oct 27, 2003
    #6
  7. Mike

    Sam Holden Guest

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

    Tintin Guest

    "Sam Holden" <> wrote in message
    news:...
    > On Mon, 27 Oct 2003 20:05:05 +1300, Tintin <> wrote:
    > >
    > > "Matthew Braid" <> wrote in message
    > > news:bnicq8$c65$...
    > >> 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.
     
    Tintin, Oct 27, 2003
    #8
  9. Mike

    Sam Holden Guest

    On Mon, 27 Oct 2003 21:16:06 +1300, Tintin <> wrote:
    >
    > "Sam Holden" <> wrote in message
    > news:...
    >> On Mon, 27 Oct 2003 20:05:05 +1300, Tintin <> wrote:
    >> >
    >> > "Matthew Braid" <> wrote in message
    >> > news:bnicq8$c65$...
    >> >> 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
     
    Sam Holden, Oct 27, 2003
    #9
  10. Mike

    Mike Guest

    >> 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
     
    Mike, Oct 27, 2003
    #10
  11. Mike wrote:

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


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

    MB
     
    Matthew Braid, Oct 27, 2003
    #11
  12. Mike

    Mike Guest

    > 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
     
    Mike, Oct 28, 2003
    #12
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SD Keane

    Host an app on remote site

    SD Keane, Sep 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    404
    Sam Santiago
    Sep 2, 2004
  2. Orpheus66
    Replies:
    0
    Views:
    4,534
    Orpheus66
    Jul 30, 2003
  3. Darren Dale
    Replies:
    2
    Views:
    328
    Darren Dale
    Jul 20, 2004
  4. Jerry Qu
    Replies:
    1
    Views:
    532
    lee atkinson
    Feb 20, 2009
  5. Bob Miner
    Replies:
    5
    Views:
    143
    Bob Miner
    Aug 9, 2008
Loading...

Share This Page