in reply to Getting error when selecting from database

Right before you do your connect, try adding this:

DBI->trace( 1, 'DBI-TRACE' );

That will put a debugging file named DBI-TRACE in your current directory with useful information. You can increment the 1 higher to get more debugging info. Maybe that will help you track down whatever is going wrong.