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.]