in reply to if (empty record set)

I have thoughts about using any array_ref as your result set from a DB call, as I like using hashref, but that's another thread. Here's what I'd do: (untested for syntax errors)
my $i = 0; while ($sth->fetchrow_hashref){$i++; ##..do other stuff.. } do_your_no_row_stuff($vars) unless $i;
Or
do_no_row_stuff() unless $sth->fetchrow_hashref; ## Of course, the first row is now useless.. but..


One4k4 - perlmonks@poorheart.com (www.poorheart.com)