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

You should never feel like you need to apologise for asking advice. That's what SOPW is for :)

Anyway, this is almost certainly a permissions problem. You need to ensure that the user the webserver runs as has appropriate permission to write to the directory involved.

Here is an example that I've tested, and works (with appropriate permissions set):

never.cgi

#!/usr/bin/perl -w use strict; use CGI qw/:standard/; use Cwd; print header(); my $dir = getcwd; my $param1 = qq(hello, cruel world. A test; for \\\$neversaint.); my @args = ( "$dir/never1.pl", $param1, "$dir/test/never.out" ); system(@args) == 0 or die "Code does not work:$!"; exit;
..and the script that is called:
#!/usr/bin/perl -w use strict; my $text = $ARGV[0]; my $outfile = $ARGV[1]; open OUT, ">", $outfile or die "$0 : failed to open output file $outfile:$!\n"; print OUT "THIS IS YOUR INPUT TEXT: $text\n"; close OUT; exit 0;
and after loading the cgi script in my web browser:
cat test/never.out THIS IS YOUR INPUT TEXT: hello, cruel world. A test; for \$neversaint +.

Cheers,
Darren


In reply to Re^7: Failed System/Exec Call under Right Permission with CGI by McDarren
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.