I’m using IPC::System::Simple:runx to execute system commands and die on unexpected return values. The problem is that the commands output is printed to the shell.
- How can I avoid printing this
output? - How can I avoid printing this output
but getting it into a perl variable?
UPDATE
3) How can I print this output iff the execution fails?
The capture() command? Or capturex().
Quoted from link:
Exception handling
In the case where the command returns an unexpected status, both run and capture will throw an exception, which if not caught will terminate your program with an error.
Capturing the exception is easy:
See the diagnostics section below for more details.