How much do you know about the C program(s) that you'll be running this way? Sometimes, when command-line tools are written to require filename args, a filename of "-" (dash character \0x2d) is accepted as referring to stdin (when the required arg is an input file name) or stdout (when the required arg is an output file name).
If your C programs follow this sort of convention, do a pipeline "open()" to launch the sub-process, and put "-" where the output file name should be. Then read from the pipeline file handle in the normal way, just like reading from any data file.
(If the C programs don't follow this convention, and you don't have / can't update the C source code, and you can't create a named pipe as suggested in an earlier reply, then you'll just have to put up with saving output to a named file, and reading that file as a separate step in your perl script.)
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.