Even better: Let DBI do that for you: connect with RaiseError => 1 and every failing DBI method will die automatically. If you expect that a function may die, wrap in in an eval { BLOCK }. This is the usual way to handle transactions: Code that may fail and the final commit are wrapped in eval, followed by a rollback when $@ is true.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] [d/l] [select] |
How do you know that the connect, the prepare and the execute "work fine"? You do not test the return value of these functions.
No, but there are already "subjects" in the database and these are read and displayed correctly. Perhaps I should have explained this further...in any case, it is *not* because $db is a bad handle. I will add the warns tho, you are right, they should be there from the start. | [reply] |