"Realer" Exceptions
- But wouldn't you prefer an object?
eval { die SQLException->new
( error => 'Bad SQL',
sql => $sql,
bound_vars => \@bound_vars ) };
if ($@)
{
warn "Error: ", $@->error, "\n";
warn "SQL: ", $@->sql, "\n"
if $@->can('sql');
}