I am actually using "out" parameters to return the error messages and capturing it in the main perl script with the help of func(syb_out_params), but this is for the user defined error messages.. My problem is what about the error messages which will not be handled by the subroutene, take for example "password has expired" while connecting to the database then database connection will not be possible and database will throw its own error.. How to catch these types of errors..