in reply to Getting a count of all rows in MySQL

The selectcol_arrayref() also will help you for getting the count.
my $data = qq[SELECT COUNT(*) FROM questions WHERE `q1` = "upright"]; my $count = $db_handle->selectcol_arrayref($data); print "Count $count->[0]\n";
Note: $db_handle is the database handle used in your code.