#!/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
####
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/MyTest/cgi-bin/test.cgi line 54.
For help, please send mail to the webmaster (webmaster@cheers.com), giving this error message and the time and date of the error.