trouble with DBI/CGI

From: David Morel (altalingua_at_hotmail.com)
Date: 11/30/03


Date: 29 Nov 2003 21:16:18 -0800

Hi,

I am having trouble combining DBI and CGI.

Consider the following program:

#!/usr/local/bin/perl -w
use strict;
use DBI;
use CGI ':standard';

print "Content-type: text/plain\n\n";
print "abc\n";
my $dbh = DBI->connect("dbi:Oracle:ORCL", "username", "password");
print "123\n";

When I run the above program from a web browser, I get the output:
abc

When I run the above program from the command line, I get the output:
abc
123

In other words, it seems that when I run the script from the web it
stops immediately after it creates the database handle... but works
properly when run from the command line.

What gives?

Thank you,
David Morel



Relevant Pages

  • RE: Can System() of Perl be bypassed?
    ... If you need to send or receive output of your 'system' command, ... This CGI would be the ... You should do some minimal sanity check on searchstring. ... Then your grep line reads ...
    (SecProg)
  • Re: Can System() of Perl be bypassed?
    ... If you need to send or receive output of your 'system' command, ... This CGI would be the ... You should do some minimal sanity check on searchstring. ... Then your grep line reads ...
    (SecProg)
  • dynamic lib ignored even after "found" in "install_driver(Oracle) failed: Cant load..." cgi problem
    ... here's a problem it seems a lot of people are seeing when running a CGI script ... after installing the the sqlplus client on my linux machine (and testing it on the command line, successfully connecting to our oracle db), and then installing the perl moduleneeded to make connections in perl scripts and cgis, i find, like so many others i've seen complain about this, that my cgi script runs fine from the command line, but fails when it is run as a CGI via my machine's apache webserver. ...
    (perl.dbi.users)
  • CGI script: release browser after spawning new process
    ... The purpose of this cgi script is to receive cgi parameters from a user ... filled form and pass them along as command line parameters to another ... perl exec because it spawns this new process and does not return. ...
    (comp.lang.perl.misc)
  • Re: SCP help
    ... > I have developed a CGI that will take information from a CGI based ... > SCP a specific file to a remote server. ... > If I do the above command from the command line all works perfectly. ...
    (perl.beginners)