in reply to Return code and output of system command?
Could you not just use backticks and get the exit status from $?