per the advice given to me,
i added $ua = LWP::UserAgent->new; after my variable declaration. The fixed the previous error (thanks so much)However, now my problem lies within my regex. Here's the updated code:
#!/usr/bin/perl
use HTTP::Request;
use HTTP::Headers;
use LWP::UserAgent;
my(@ListingsUrls, $req, $ua, $responsecode, $res, $row, $url);
$ua = LWP::UserAgent->new;
$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);
print $row . "\n";
}
if ($row =~ (/Updated\s*:\s*\w+\s*-\s*\d{1,2}:\d{1,2}\d{1,2}\s
+* PST/)){
print $1;
}else{
print "html didn't contain Updated";
}
I added a print statement to $row and i can see what i am looking for(this is an excerpt from my console when the line print $row is executed):
<tr>
<td>
<p></p><br>
<center>
<font face="Arial, Helvetica" size="-1">
<b>Updated: Mar-11 23:05:50 PST</b>
Any advice would be greatly appreciated.
thnx, Ray