on Thu, 16 May 2002 18:03:12 GMT, Rory Oconnor wrote:
>
> 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?
You can always put the following in your script:
END {
$dbh->disconnect() if $dbh;
}
which will be executed even if your program 'die's.
--
felix
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]