in reply to Handle DBlib error

It seems that the question you have has already been asked before. Look at this thread: Error Handeling in Sybase::Dblib. Especially this excellent reply by mpeppler, where he explains how to create a message handler subroutinne and then install it using:

dbmsghandle(\&message_handler);

Which should be exactly what you are looking for. Good luck!

- Luke