Regarding your post, it's customary to wrap code sections in <code> tags. If you could update your post, that would be appreciated.
Regarding your DBI question, why don't you ask DBI what the problem is by outputting DBI->errstr in your error message, rather than a generic message? Also, I typically make a connection with RaiseError => 1
Another thing to check is whether the user you're connecting to the database as, has sufficient privilege to delete table rows.
Alex / talexb / Toronto
"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds