my $sth= $dbh->prepare("DELETE FROM table_name WHERE col2=?"); $sth->execute("X"); my $rows = $sth->rows();