in reply to fetchrow_hashref failed problem

What you described doesn't make sense to me unless DBD::mysql or DBI is broken as execute is supposed to return undef on an error. What do you get if you change the if statement to assign the execute return to a variable and then dump it when fetchrow_hashref fails?

Have you tried enabling DBI tracing to see what is going on?