my $SQLString "select COUNT(1) from there"; $sth = $dbh->prepare($SQLString); $sth->execute(); @bkmark = $sth->fetchrow; if($bkmark[0] == 0) { ........... }