in reply to Can insert but not select

I suggest you to use default perl debugger or use Devel::sdb to debug your code of yourself, you will be able to solve your problem with ease I believe.