And the system call is as follows:#!/usr/bin/perl -w my $text = $ARGV[0]; my $OUTFILE_file_name = $ARGV[1]; # output file name open ( OUTFILE, '>', $OUTFILE_file_name ) or die "$0 : failed to open output file $OUTFILE_file_name : $!\n" +; print OUTFILE "THIS IS YOUR INPUT TEXT: $text\n"; close ( OUTFILE ); # close output file
But when I run it. It gives this as output in the browser:my @args = ( # This is line 54 '/home/myname/public_html/MyTest/prn_to_file.pl', $param1, '/home/myname/public_html/MyTest/results/output.txt' ); system(@args) == 0 or die "Code does not work $!";
Testing System/Exec function with CGI This text _should_ be printed to the file : foo bar Software error: Code does not work Bad file descriptor at /home/myname/public_html/MyT +est/cgi-bin/test.cgi line 54. For help, please send mail to the webmaster (webmaster@cheers.com), gi +ving this error message and the time and date of the error.
In reply to Re^6: Failed System/Exec Call under Right Permission with CGI
by neversaint
in thread Failed System/Exec Call under Right Permission with CGI
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |