Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use LWP::Debug qw(level); level('+'); use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(10); my $resp = $ua->get("http://www.yahoo.com/"); my $resultUsingLWP; if($resp->is_success) { $resultUsingLWP = $resp->content; } else { $resultUsingLWP = $resp->status_line; } print "Content-type: text/html; charset=utf-8\n\n"; print "LWP result: {$resultUsingLWP}"; print "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP running as cgi
by merlyn (Sage) on Sep 21, 2008 at 15:24 UTC | |
by Anonymous Monk on Sep 21, 2008 at 15:44 UTC | |
by jethro (Monsignor) on Sep 21, 2008 at 16:01 UTC | |
by betterworld (Curate) on Sep 21, 2008 at 16:21 UTC | |
by elwoodblues (Novice) on Sep 22, 2008 at 10:35 UTC | |
by betterworld (Curate) on Sep 22, 2008 at 23:10 UTC | |
| |
|
Re: LWP running as cgi
by oko1 (Deacon) on Sep 21, 2008 at 15:42 UTC | |
by Anonymous Monk on Sep 21, 2008 at 16:20 UTC | |
by holli (Abbot) on Sep 21, 2008 at 17:47 UTC | |
by elwoodblues (Novice) on Sep 21, 2008 at 18:07 UTC | |
|
Re: LWP running as cgi
by jethro (Monsignor) on Sep 21, 2008 at 15:39 UTC | |
|
Re: LWP running as cgi
by kubrat (Scribe) on Sep 21, 2008 at 17:41 UTC |