Patience, Grasshopper. Although the monks are often quick to respond, we have other concerns to attend to and may not always notice your queries immediately.

Enabling taint mode tells the Perl interpreter to watch your program's handling of user-entered data and refuse to do anything unsafe with it. The Anonymous Monk who originally answered was attempting to point out, with his suggestions of taint mode and that you should read perlsec (the perl security manpage), that you appear to be handling user input in an unsafe manner.

Consider the possibility that a malicious user might craft his input such that $myQuery holds the value ; rm -rf /. Would this not cause the shell to run test_process.pl with no input, then proceed to attempt to delete your entire file system? Using taint mode will be a great help towards preventing such errors.

To debug this, you would do well to look at your web server's error log, as it has most likely recorded perl's objections to what you requested of it. In the case of taint mode violations, this will include the location in which you attempted to do something unsafe. See perlsec for information on how to cleanse the tainted data.

As to your original question, your thought that perhaps you should call a function from test_process.pl directly rather than running it through a shell is most likely the correct course. The most effective way to do this would be to convert test_process.pl, or at least the relevant function(s), from a standalone script into a module. If you provide additional information on the script and function(s) involved, you are likely to receive reasonably detailed assistance in doing so.


In reply to Re^5: calling external program from CGI by dsheroh
in thread calling external program from CGI by stan131

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.