I\'m trying to basically do a search through the database with Perl to tell if there is an item with a certain ID. This search can return no rows, but it can also return one
Change select to always return something? This should work in Sybase, dunno about other DBs.
my $th = $dbh->prepare(qq{SELECT count(*) FROM bounce_info WHERE bi_exim_id = '$exid'}); $th->execute(); if ($th->fetch()->[0]) { .... }