in reply to DBI, rows, and do
You must check for rows() > 0, not for truth of rows(). As per the docs, rows() returns the number of rows impacted or '0E0' (zero but true) if no rows were impacted or -1 for unknown number of rows. It only returns undef if the statement failed. A DELETE that finds no rows to delete is not a failure.