I have a CGI script that uses the parameter passed to it as an argument for another perl script,xx.pl. However, I was unable to run xx.pl when running from the web.I did something like this:

<P>open(A,"xx.pl $value|"); while(<A>){ $results .= $_;}</P>

when i run it from the command line, there is no probl. but it doesnt work when accessing from the web

After troubleshooting, I've found out that:
1) the parameter,$value is being passed correctly
2) xx.pl is accessible to all, chmod 777 xx.pl
3) when I replaced xx.pl with a simple command, ls , it works perfectly
4) when I put 'ls' into a shell script and use it to replace xx.pl, it doesnt work again

I think I'm missing out a crucial point somewhere. Can anyone offer me some insight? Thanks


In reply to Running an external script from a Perl CGI script by Eureka_sg

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.