First of all, find out what the correct environment variables should be. If you can connect to Oracle via sqlplus then chances are you have the correct variables. So, a quick
env | grep ORACLE on the command line should give you what you need.
Add those variables to your CGI prog:
$ENV{ORACLE_HOME} = "/path-to/oracle-home";
# etc...
--
vek
--