MintyFresh has asked for the wisdom of the Perl Monks concerning the following question:
That shows every URL as being dead even if it's not. If I change..... my($query) = "SELECT weburl, webdate FROM table WHERE approval = ' +1' LIMIT 10"; my($sth) = $dbh->prepare($query); $sth->execute || die("Could not execute!"); while(@row = $sth->fetchrow_array) { $whereto = "$row[0]"; &letsgo; } exit; sub letsgo { $ua->agent("Mozilla/8.0"); $req = new HTTP::Request 'GET' => '$whereto'; $res = $ua->request($req); if ($res->is_success) { print "$whereto WORKS\n"; } else { print "$whereto doesnt work\n"; } }
to something like$req = new HTTP::Request 'GET' => '$whereto';
It works fine. What am I missing when getting URLs from the database?$req = new HTTP::Request 'GET' => 'http://www.google.com';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Checking URLs with LWP::UserAgent
by Fastolfe (Vicar) on Dec 04, 2001 at 03:01 UTC | |
|
(crazyinsomniac) Re: Checking URLs with LWP::UserAgent
by crazyinsomniac (Prior) on Dec 04, 2001 at 03:33 UTC |