I have an application running in PERL Script and now we require to connect PERL with ORacle database. After doing some research work and getting helps from this site somehow I am able to connect with the Oracle database from PERL. However when I run the script(s) manuaaly it works fine, the script connects to Oracle, read/write, commit/rollback and exit from the Database. But when the same script I tried to run through some job scheduler like "autotsys" (a s/w which schedules the job on Solaris env) the script(s) fails and it gives an error saying "ORA-12154: TNS: Could Not resolve service name(DBD: Error: OCIServerAttach)".
Afterwards I set some environment variables required to connect to the Oracle database before the "onnect" command i.e. "ORACLE_HOME" and "TWO_TASK". So we need any other env. variables to connect to Oracle database. Please note here that "Autosys" is unale to read the env. variables from the shell environment.
At least for me on Solaris PERL's DBD/DBI interface is case sensitive when it comes to entries in the tnsnames.ora file. Another "GOTCHA" is
whether or not within your sqlnet.ora "NAMES.DEFAULT_DOMAIN" is defined (or not). Ideally if/when you can successfully connect to the DB in question using "sqlplus username/password@alias", then you should be able to use the same alias for PERL; because PERL use the exact same mechanism as SQL*PLUS.