in reply to I want to capture a programs output AND I want the return status
Use backticks and $?. From perldoc perlvar:
$? - The status returned by the last pipe close, backtick (``) command, or system() operator. Note that this is the status word returned by the wait() system call (or else is made up to look like it). Thus, the exit value of the subprocess is actually ($? >> 8), and $? & 127 gives which signal, if any, the process died from, and $? & 128 reports whether there was a core dump. (Mnemonic: similar to sh and ksh.)
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
|
|---|