So there are three programs. The first program (let's call this one "master") starts one of the other programs (let's call this one child1) and then gets some values back. These values are then given to the last program (let's call this child2) which does more stuff with them.

If I understand your statement correctly, you want to take the get data from child1 and make it command line parameters for child2. If so you need to check out the 'back-tick' operator (the quote-like thing on the tilda key). Passing stuff as parameter to child2 is easy by either the system command or by opening a pipe.

This is extensively covered in PERL documentation. Look at man perlfunc for the "system" command. Look at man perlop for the "backtick" operator. and look at man perlipc for even niftier ways of making programs talk to each other (with examples even). There is even a man perlopentut which is structured as a tutorial for the "open" command (the part that would help you is called "pipes").

-- termix


In reply to Re: How to get value from one Perl program to another? by termix
in thread How to get value from one Perl program to another? by sachinb

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.