if ( $? == 0 ) { return $cmd_return; } else { die "$cmd failed with error: $?"; }