G'day boardman411,
Welcome to the monastery.
Without seeing the context of the system call within your code, or knowing what ProgramName does, it's a little hard to give a definitive answer.
I'm also unsure as to what you specifically want to do: suppress output? capture output? send a Ctrl-C? run in the background? some combination of these? something else?
Here's a few suggestions, in no particular order:
-
You appear to be running on a *nix system. You can use 'command &' to run in the background; 'command > output_file' to redirect output; 'command > /dev/null' to discard output.
There's all sorts of variations of these: consult your system manual page(s).
Also, nohup is used to ignore a SIGHUP; it's unrelated to SIGINT (which is what Ctrl-C generates): man nohup should explain how this is implemented on your system.
-
Take a look at the system documentation.
You'll find links to alternatives (e.g. qx and fork). Also read what it says about SIGINT.
-
"perlipc - Perl interprocess communication" describes a plethora of methods that might be of use to you.
-
For capturing output, Capture::Tiny may do what you want.
Also, its SEE ALSO section lists many modules with similar or related functionality.
-
The Expect module is another possibility.
In particular, see its "How do I send control characters to a process?" section.
[Aside: A better question will get better answers.
Take a look at the guidelines in "How do I post a question effectively?" to find out how to do this.
Also, "How do I change/delete my post?" explains how to update what you've already posted.]
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.