in reply to Counting rows Sqlite

Why let Perl do all the work, when SQL can do it?
$count = $dbh->selectrow_array('SELECT count(ID) FROM table WHERE col1 + = ?', \%attr, 'xxx'); print "Number of rows selected: $count ";

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James