$count = $dbh->selectrow_array('SELECT count(ID) FROM table WHERE col1 = ?', \%attr, 'xxx'); print "Number of rows selected: $count ";