Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

LWP missing objects

by gw1500se (Beadle)
on Aug 18, 2008 at 22:44 UTC ( [id://705089]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://705089]
Approved by jettero
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2024-04-23 14:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found