in reply to Re: Re: Re: Perl dbi disconnect question...
in thread Perl dbi disconnect question...

Ah, I see. So I should have a different bail out sub when an error occurs during a query execution. Will the following do?

sub bail_out2 { my $message = shift # output error in html # exit with 1 because it's a failure exit(1); }
Does exiting with the value of 1 automatically kills the database connection?

I need to print out the error in html to let the user know that something has gone wrong with the processing of the script. die prints the error to the log which is invisible to the user. Am I right?