my $sth = $dbh->prepare("select val1 from tb11 where x=?"); ... $dbh->selectcol_arrayref($sth, undef, $x);