in reply to Counting rows Sqlite

selectall_arrayref returns a reference to an array of rows.
my $all = $dbh->selectall_arrayref(" SELECT ID, col1, col2 FROM table WHERE col1 = 'xxx' "); print "Number of rows selected: ", 0+@$all, "\n";
or if you don't actually need the rows:
my ($count) = $dbh->selectrow_array(" SELECT COUNT(*) FROM table WHERE col1 = 'xxx' "); print "Number of rows selected: $count\n";