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


in reply to Re: DBD::mysql::st execute failed: You have an error in your SQL syntax;
in thread DBD::mysql::st execute failed: You have an error in your SQL syntax;

It's a personal preference, but all you need is RaiseError set to 1 (as you have).