I know this has probably been answered here before, but I'm going to ask it here anyway.

I have a Perl program (not a CGI script) that needs to call another program. This is not like the one calling many issue I had before. This is a simple one calling one once plan. The second program is going to genereate output that will go back to the first one. I can do this by piping, or I can make copies of this second program and put the relevant code in each Perl program that is going to use it, but both seem like the long way about doing this.

The basic concept is something like this:

In program one, there will be a line like:

$gimme = #some call to the second program;
It should be noted here that the call will also pass 2 parameters, in the form of variables, $var1 and $var2.

and in program two:

#!usr/local/bin/perl $output = "blah"; #actually generated in the program return $output; #...or something I don't know if return # is the right statement here either.
I'm sure there has got to be a simple solution to this. I'm just not foo enough to have it down in my brain yet.

In reply to Perl Script Calling Another Perl Script by mcogan1966

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.