in reply to Re^2: Using a Fetchrow with LWP
in thread Using a Fetchrow with LWP
"but this doesn't..."
use LWP::UserAgent (); use DBI; use parent 'HTTP::Message'; $mess = HTTP::Message->new(); $mess->encode(gzip,deflate); my $ua = LWP::UserAgent->new(timeout=>10); $mess = HTTP::Message->new(); $mess->encode(gzip,deflate); $ua->default_header('Accept Encoding'=>$mess=HTTP::Message->new()); $ua->default_header( USER_AGENT =>'COMPANY admin@example.com' ); my $SQL = "select url,filename from linktable"; my $sth = $dbh->prepare($SQL) or die "Prepare".$dbh->errstr; $sth-> execute() or die "".$dbh->errstr; while (my $row = $sth->fetchrow_arrayref) { my ($url,$filename)= ($row->[0],$row->[1]); print "\n$row[0] $row[1]\n"; my $resp = $ua->mirror( $url,$filename); if ( $resp->{success} ) { print "OK\n"; } else { print "Failure: $resp->{status}, $resp->{reason}\n"; } }
no strict, no warnings, no creation of a database handle object, it's almost as though you've ignored everything 1nickt has provided in this thread...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Using a Fetchrow with LWP
by justin423 (Scribe) on Jul 19, 2023 at 11:12 UTC | |
by marto (Cardinal) on Jul 19, 2023 at 11:34 UTC | |
by marto (Cardinal) on Jul 19, 2023 at 11:37 UTC | |
by justin423 (Scribe) on Jul 19, 2023 at 13:04 UTC | |
by marto (Cardinal) on Jul 19, 2023 at 13:08 UTC | |
by justin423 (Scribe) on Jul 19, 2023 at 14:06 UTC | |
|