I am new to Perl programming (and for SO too), so my question may not be formulated correctly, but I really read a lot of books and manuals and I did not find anything that concerned (even mentioning) my problem.
I am trying to use DBI and SQLite to write code that repeats the insertion request if a recovery error occurs (full or locked DB, etc.), but dies if the error is unrecoverable (the database is deleted or damaged, etc. )
I found that the SQLite C interface is exporting error codes:
http://www.sqlite.org/c3ref/c_abort.html
but I did not find anything like it for Perl. I'm sorry that I don't need to use magic numbers in my first Perl program !:-)
By the way, the documents and examples that I saw on the Internet very well explain manual processing errors or automatic (i.e. with exceptions) in DBI, but none of them show how to perform different actions according to type mistakes. Is this not an ordinary case? Moreover, they all agree that DBI :: err is not a valid variable to report which error occurred. They more or less implicitly say that DBI :: errstr should be used, but I find it a little awkward to rely on comparing strings with a human-oriented, perhaps multi-line error string ...
Thanks for any suggestion!
David source share