I have seen this in many places in Perl scripts:
system("binary");
$exit_code = ($? >> 8)
exit($exit_code)
Why should I use this? Is there an alternative way?
I am calling some binary in
system(binary)which I created in C++, which does some stuff and if it fails it givesassert. When I reboot a Linux machine, the stuff which is going fails, and my binary generatesassertas expected. But on the Perl side where I called it, it throws a134error code, which after134 >> 8, becomes0. Ultimately it is making my failure operation a success (which I don't want).