I'm a little confused... Your original "a.pl" program captures the output from your other script, and assigns it to $ret. If the other script were running in the background (so that "a.pl" continues to do other things at the same time), do you still need the output of that other script to be assigned to some variable in "a.pl"?
Maybe you've already figured that part out, but it wasn't clear from your post or other replies in the thread, and it would make a difference in terms of what a correct solution would look like.
Obviously, if you want output from the other script to be assigned to a variable in "a.pl", and you want the other script to run in the background, you have to save it's output to a file, have "a.pl" doing other stuff (possibly including "wait" or "waitpid") until the background job is done, then read the output file that it created. Or maybe you can find another technique in perlipc that would make more sense for you.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.