in reply to return value from system call, exit status, shift right 8, bitwise and, $?
Others have covered your original question pretty well so I'll just chip in that I'm a fan of this construct in my code to get both the output and the RC.
This doesn't quite cover all the bases but can be expanded to do so.
eval { open P,"$cmd 2>&1 |"; }; if($@) { die('Cant launch cmd') } my @output=<P>; close P; my $rc = $? >> 8;
|
|---|