...correct me if I'm wrong, but you still may have a problem.

Supplying the full path will get this additional script to run, but I don't think you're going to get the output from the command by grabbing the return value from system().

What you'll get stored in $output will simply be the exit code from your other script.

So here's how you can execute the external script and grab the output into a variable:

open (PROC "/path/to/perl myscript.pl |") || die "horribly"; @lines = <PROC>; close PROC;

You may want to add other civilities, such as join()'ing the lines of output into one big scalar if that suits you. But this is one good way of grabbing output from a running process. Best of luck.

---v


In reply to Re: Re: Re: Executing another script from a CGI by agentv
in thread Executing another script from a CGI by higle

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.