my $res = $dbh->selectall_hashref($stmt, $key); print scalar(keys %$res);