in reply to Empty Hash?

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";

Replies are listed 'Best First'.
Re^2: Empty Hash?
by jZed (Prior) on Dec 31, 2004 at 16:53 UTC
    > you can either set RaiseError, or check the returned set

    Setting RaiseError will not tell whether rows have been selected - it is not an error to make a SELECT statement that finds 0 rows.