as described here :
http://search.cpan.org/~timb/DBI-1.46/DBI.pm,
you can either set RaiseError, or check the returned set.
ps. you can also use scalar(@array) for the size of an array, and scalar(keys %hash) for the size of a hash.
little example:
#!/usr/bin/perl -w
use strict;
my %none;
my %more=(one=>"1", two=>"2");
print "none: ". scalar(keys %none) . "\n";
print "more: ". scalar(keys %more) . "\n";