http://www.perlmonks.org?node_id=535144


in reply to Catching DBI (or other) errors

I suggest that you either replace the curly braces with parentheses, or use 'or' rather than '||':
$query->execute() || ($SQL_FAIL =1); $query->execute() or $SQL_FAIL =1;
'or' has a lower precedence than '=', but '||' has a higher precedence, which is what makes parentheses necessary in your original statement.