in reply to Re^2: last_insert_id issue
in thread last_insert_id issue

Personally, I wouldn't wrap it in an eval block. I'd either enable RaiseError on the $dbh handle and let the module tell me when there was an error, or I'd manually check the return status of each db call and die if needed.

The advantage of letting the module handle the error checking/handling is that it's less code that I have to write while still retaining a reasonable level of error handling. The advantage of manually checking each call is that I have more control over how I want to deal with the error handling.

my $dbh = DBI->connect("dbi:ODBC:$DSN", {RaiseError => 1}) or die "DB connection failure\n" . $DBI::errstr;