my $sth = $dbh->prepare($your_sql_statement); my $row = $sth->fetchrow_hashref; print "not good\n" if ($row->{date} + (60*5) < time); $sth->finish;