sub updater { my $update_url_to; my $sth = $dbh->prepare(qq{ SELECT url_to FROM webcrawler where next_date = CURDATE() LIMIT 1 }); $sth->execute(); $update_url_to = $sth->fetchrow_array(); $sth->finish(); if (defined($update_url_to)) { $si=1; } if ($si eq "1"){ print "[$identify][U]------> Proceeding to update $update_url_to\n"; &download("$update_url_to"); } }