my $db = DBI->connect("dbi:Oracle:host=shost;sid=$sid;port=$port", $uid, $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); }