"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...
In reply to Re^3: Using a Fetchrow with LWP
by marto
in thread Using a Fetchrow with LWP
by justin423
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |