my $sth = $dbh->prepare("SELECT * FROM foo"); $sth->execute(); my $num_rows = $sth->rows;