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

I am trying to write a script that uses LWP (perl 10.5.0) with Cygwin. I am trying some of the simple examples scattered around but cannot get anything to work except, seemingly:
use LWP::UserAgent; use LWP::Simple; $req=LWP::Request->new(GET=>"www.mysite.com");
That seems to return a hash but when I use '$req->is_success', or '$req->content' or '$req->status_line' on I get errors saying can't locate the object method. Can someone help me figure out what I'm doing wrong? TIA.

Replies are listed 'Best First'.
Re: LWP missing objects
by jettero (Monsignor) on Aug 18, 2008 at 22:46 UTC
    That's because there is no LWP::Request. I believe you're looking for HTTP::Request.

    -Paul

      Yep. I got all discombobulated between HTTP, LWP etc. and the various returned hashes. I got it now. Thanks to both of you.
Re: LWP missing objects
by olus (Curate) on Aug 18, 2008 at 23:03 UTC

    In my case it seems to be returning a scalar

    Can't locate object method "new" via package "LWP::Request" (perhaps you forgot to load "LWP::Request"?) at lwp.pl line 4.

    Try the examples on lwp docs.

      I think that is it. I did not realize they were all separate packages.