in reply to if (empty record set)

Instead of using $sth->fetchrow(), call $sth->rows() instead, which returns the number of rows that were hit:

my $SQLString "select this, that from there"; $sth = $dbh->prepare($SQLString); $sth->execute(); if($sth->rows() == 0) { ........... }

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated