Man here almost 9 years later I am going through the same head against the wall, bleeding, eyes flaming. Oracle is really the biggest pain to config and I go through this every so many years.
To all those with idea it's the tnsnames.ora or it cant find it is just flat wrong. Why?
tnsping hits my alias in tnsnames.ora fine
toad works fine with the same oracle home
sqlplus connects with tnsname
environment vars set
ORACLE_HOME standard app/client/"username"/client/oracle
TNS_ADMIN oracle_home/network/admin
then perl dbi TNS:could not resolve the connect identifier
!!! WHAT THE HECK !!!