You could narrow down your search and speed up finding where its broke by appending
to each DBI function call. Then you'd know where and why it didn't work. Also - you don't say where
came from? On the face of it it's possible you don't have a functioning db handle. I only mention this for the sake of completeness - not trying to tell you something you know :)