Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: URL post

by arthas (Hermit)
on Aug 18, 2003 at 23:24 UTC ( #284755=note: print w/replies, xml ) Need Help??


in reply to URL post

Hi!

The script has some errors. Here's a fixed version:

use HTTP::Request; use LWP::UserAgent; my $url = "http://somedomain.com/cgi-bin/somescript.cgi?variouscharact +ers"; my $ua = new LWP::UserAgent; my $req = new HTTP::Request(GET => $url); my $res = $ua->request($req); if ($res->is_success) { print $res->content; } else { die "Not possible\n"; }

Among the other things, you should really use GET as request method for an URL like the one you provided. Also, take a look at the numerous exampels in the LWP documentation, they're very useful.

Michele.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://284755]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2019-05-20 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (128 votes). Check out past polls.

    Notices?