in reply to Capturing SGE exit code in Perl
I get an error related to strict because of the @cmd array
So, is the $cmd you pass in a reference to an array or not? If so, you can just supply @$cmd as the argument to capture_exec. If not, then what is it? Just the command with no arguments? Then you should be able to just pass $cmd to capture_exec (if there are no arguments).
When learning/testing command execution code, its easiest to start with something simple, like ls -l. Then ls -l file1 file2 (assuming file1 and file2 exist), and to test what happens on error, something like ls -l file1 file_that_does_not_exist.
|
|---|