The Oracle Environment Parameters are not set from with in the CGI when called from HTML , I guess and hence get those Oracle env parameters in a file and
require "./oraenv.pl";
in your CGI . This may help recognize the Oracle env. Also see the error message in web server log.