RayRay459 has asked for the wisdom of the Perl Monks concerning the following question:
I get this error when i run this:#!/usr/bin/perl use HTTP::Request; use HTTP::Headers; use LWP::UserAgent; my($req, $ua, $responsecode, $res, $row, $url); $url = "http://listings.test.com/aw/listings/list/category12"; $request = new HTTP::Request('GET',$url); $ua->timeout(10); $response = $ua->request($request); my $responsecode = $response->code(); next if $responsecode != 200; #} @ARRAY_OF_LINES = (split "\n", $ua->request($request)->as_stri +ng); $request->as_string; foreach $row (@ARRAY_OF_LINES) { chomp($row); } if ($row =~ /Updated/){ print $1; }else{ next; }
Any advice that you have for me would be greatly appreciated.Can't call method "request" on an undefined value at url.pl line 7.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: my code error-ing out trying to grab html
by mdillon (Priest) on Mar 12, 2002 at 08:18 UTC | |
by RayRay459 (Pilgrim) on Mar 12, 2002 at 09:00 UTC | |
|
Re: my code error-ing out trying to grab html
by RayRay459 (Pilgrim) on Mar 12, 2002 at 08:59 UTC | |
by davis (Vicar) on Mar 12, 2002 at 09:33 UTC | |
by zengargoyle (Deacon) on Mar 12, 2002 at 09:54 UTC |