I was suspicious that when you ran the code from the command line it was using some of you environmental variables upon which Oracle communication is dependent. And, that the web daemon, running as 'nobody', probably, might not have those variables set. I found the following and cut/pasted it from
This is a very good page for anyone doing anything with the DBI/DBD modules. I hope this helps.
4.4 "When I run a perl script from the command
line, it works, but, when I run it under the httpd, it
fails!'' Why?
Basically, a good chance this is occurring is due to the fact that the user that you
ran it from the command line as has a correctly configured set of environment variables, in the case of DBD::Oracle, variables like ORACLE_HOME, ORACLE_SID or TWO_TASK.
The httpd process usually runs under the user id of nobody, which implies there is no configured environment. Any scripts attempting to execute in this situation will correctly fail.
One way to solve this problem is to set the environment for your database in a
BEGIN { } block at the top of your script. Another technique is to configure your
to pass-through certain environment variables to your CGI scripts.
Similarly, you should check your httpd error logfile for any clues, as well as the ``Idiot's Guide To Solving Perl / CGI Problems'' and ``Perl CGI Programming FAQ''
for further information. It is unlikely the problem is DBI-related.
The ``Idiot's Guide To Solving Perl / CGI Problems'' can be located at:
as can the ``Perl CGI Programming FAQ''. Read BOTH these documents carefully!
keep the rudder amid ship and beware the odd typo