September 28th, 2012, 04:46 PM
Do I havve to print to the screen?
In scripts that I've used, If I don't print to the screen at one point, I will get an error. If i do put a print in there so it is printing to the screen I get on errors.
My question is do I have to print to the screen or STDOUT? And, if it just has to be STDOUT can I redirect STDOUT to some where else (maybe a file) and print to STDOUT after the redirection and not get an error?
September 28th, 2012, 05:00 PM
Did you not understand my answers to your prior question on this exact same issue?
Please read through some of the links in this google search to learn "how cgi scripts work".
September 28th, 2012, 05:08 PM
Can you give us some code to look at and exactly what errors you are getting?
** This prints to a file
my $log_file = "/tmp/log_file.log";
open( LOG_FILE, "+>>$log_file" ) or die( "Couldn't create/open log file: $log_file.\n" );
print LOG_FILE "Text written to log file.......\n";
close LOG_FILE or die( "Couldn't close log file: $log_file, $!.\n" );
** This prints to you screen if you are running script from command line
** and have not redirected STDOUT
print "This just prints to screen if you are running from command line...\n";
September 28th, 2012, 05:13 PM
The OP's question is being asked in a CGI context. The OP does not understand cgi form submission process.