in reply to SQLite: how to get a number of rows from SELECT query

scalar + selectall_array (or selectall_arrayref might be your friends here). If you need a memory "lite" option and can afford an second SQL call, there's always the SQL COUNT(*) dealio.
But if say you have all rows in $results_ref (an array ref); it'd be like:
my $results_ref = $dbh->selectall_arrayref(....); if (@$results_ref) { # ... do stuff } # or just get $count, (using `scalar` for clarity but it's already in +scalar # context so works without it here) my $count = scalar @$results_ref;