After much debugging, I have determined that a file handle in a subroutine is making my web CGI ticked off. The browser is saying:
Software error: cannot open file <-- For help, please send mail to the webmaster (r...@localhost), giving this error message and the time and date of the error. It runs perfectly fine if I run it from my linux shell. But in a broswer the CGI is trying to find the FH. Why? If I comment out the FH stuff, the html output does not supply the error above. Why would it behave this way? Here is what I have: use CGI(":standard"); use CGI::Carp qw ( fatalsToBrowser ); ###################################################################### # SQL QUERY # ###################################################################### sub sql_lookup { foreach (@map_results1){ ##### # Declaration ##### my $sql_extra1 = " set serveroutput on set feedback off\n"; ##### # Create the SQL command file ##### open (SQL,">","/usr/tmp/sqlplus_tmp.log") or die "cannot open file\n"; print SQL $sql_extra1; print SQL "exec corp.NETWORKTEAM_GETBUSNAME ('$_')\n"; print SQL "exit"; close (SQL); ##### # Run the command and capture the output. ##### @sqlplus_output = qx(sqlplus -S xxxx/xxxxxxx...@crprd01.xxxxxxxx \@/ usr/tmp/sqlplus_tmp.log); foreach (@sqlplus_output){ unshift (@printme, "$_"); } }#end foreach }#end sub ########################################################################################## # HTML PRINTER # ########################################################################################## sub html_printer{ print "Content-type: text/html\n\n"; print "<html>"; print "<head><title>xxxxxxxxx Query Tool</title></head>"; print "<body bgcolor=#000000 text=$white>"; print "<p align=center><b><font color=#FFFFFF size=6>xxxxxxxxxr Query Tool</font></b>"; print "<br>"; print "<p align=center><font color=#FFFFFF>Submitted on $dateStamp[0] EST</font></p>"; print "<br>"; print "<font color=#FFFFFF>"; foreach (@printme){ print "$_ <BR>"; } print "</html>"; }#end sub ########################################################################################## # MAIN # ########################################################################################## sql_lookup(); html_printer(); p.s. I have to do my Oracle this way with the FH and sqlplus. The DBI is not an option currently. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/