I'm not a DBI guru but I guess if you "try and catch" your DBI exception handling 
with eval, you can exit properly at all.
I mean:
eval{
$dbh=DBI->connect($connect_string);
$sth=$dbh->prepare($sql);
$sth->execute();
#some fetch here
$sth->finish();
$dbh->disconnect();
}
if($@)
{
print "program failed because : $@\n";
exit;
}
José.
  rory oconnor <[EMAIL PROTECTED]> a écrit : 
Regarding perl DBI - I know it's proper to use $sth->finish and
$dbh->disconnect and I am doing that at the end of my script...

however, i am also doing alot of error checking at the beginning of the
script (to make sure data has been entered, and formatted properly). If
there's an error I would usually just send back an error message and
exit the script to prevent it from having to run through the rest of it
needlessly. do I need to explicitly disconnect before exiting in those
instances or it it OK to just exit?

thanks,

rory


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------
Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en français !

Reply via email to