my $data = qq[SELECT COUNT(*) FROM questions WHERE `q1` = "upright"]; my $count = $db_handle->selectcol_arrayref($data); print "Count $count->[0]\n";