You can use
DBD::Mock to find out what statements you're sending to the DB. This also has the side-benefit of creating tests for your DB interactions.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?