in reply to Re: Use of unitialized variable?
in thread Use of unitialized variable?
use strict; use LWP::UserAgent; use HTTP::Request::Common; print &getHTML('http://www.perlmonks.org'); sub getHTML($) { # one $ means one scalar arg - for us humans my $url = shift; #create a new agent and name it my $ua = new LWP::UserAgent; $ua->agent("Shmozilla/0.1 " . $ua->agent); #create new request my $req = new HTTP::Request GET => $url; #send the and try to get a response my $resp = $ua->request($req); return ($resp->is_success) ? $resp->content : "Error\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Re: Use of unitialized variable?
by merlyn (Sage) on Aug 29, 2000 at 05:40 UTC | |
by jeffa (Bishop) on Aug 29, 2000 at 05:52 UTC | |
by merlyn (Sage) on Aug 29, 2000 at 05:55 UTC | |
by jeffa (Bishop) on Aug 29, 2000 at 05:59 UTC | |
by merlyn (Sage) on Aug 29, 2000 at 15:01 UTC |