You can find out how many rows a DBI statement returned using the $sth->rows method.
Note that DBI only promises that this will be accurate after you have retrieved all the rows. Whether it is reliable before then is probably database and DBD driver dependant.