Hello All,
Greetings!!
Here is a piece of code, using which,I am trying to capture the Error code in a log file on the "die" event. I need to avoid printing the error message on the Console.I havent been successful so far.
Kindly Advice.
Anandamy $db = DBI->connect("dbi:Oracle:host=shost;sid=$sid;port=$port", $ui +d, $pwd) or {capture_error()}; #===================================================================== # simple debugging routine #===================================================================== sub debug { if ($debug_output) { # print STDERR @_; # Just return if it fails to open debug file open(OUT, ">>$debug_output") || return; print OUT @_, "\n"; close(OUT); } } #===================================================================== # capture error routine #===================================================================== sub capture_error { debug("Error while connecting to database!!!\nIncorrect Connection + information\n"); exit(0); }
In reply to Capturing Error message in a log file. by Ananda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |