in reply to Re: DBI Connect Error Trapping
in thread DBI Connect Error Trapping

Shemp is right - the only thing you're missing in your code is the "eval". RaiseError causes dbi statements to *die* when they have an error(so that you don't have to put a "die" with a message along with each dbi statement), and the eval puts the die message into the special $@ variable. So after the eval, you just test the $@ variable - if it has something in it, then something within the eval failed. If you've just got the connect inside the eval, then you know your connect failed. Again, the the error *message* is in the $@(dollar - at-sign) variable.

Read about RaiseError and "eval" by doing
perldoc DBI
at a command prompt

HTH.