$sth = $dbh->prepare('select * from MyTable where 1=0') || die $dbh->errstr; $sth->execute() || die $dbh->errstr; $names_aref = $sth->{NAME};