Dear McDarren,
So sorry to have to comeback to you again McDarren. I'll try not to trouble you again after this....

I've followed your suggestion. Now I have modified my prn_to_file.pl to take two arguments. It looks like this:
#!/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
And the system call is as follows:
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 $!";
But when I run it. It gives this as output in the browser:
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.


---
neversaint and everlastingly indebted.......

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.