Does the status of null return codes always mean success in Perl?

I have a Perl script that will execute three applications. They all have different exit codes.

The state of the first application exit code is 1. The application exited normally without any problems. (Successful)

The second application exit code is 99. However, the application exited normally without any problems. (Successful)

Finally, the third application exit exit code is 0. The same with the first and second, the application came out fine, without any problems. (Successful)

Note. Already shift the status of the 8-bit exit code to the right.

The question is, does the exit code status always return to 0 if it is launched successfully?

Please, not a harsh comment, I'm just confused. Please advice.

+5
source share
2 answers

The return status is selected by the child process. For success, it is usually zero, but there is nothing to enforce this agreement.

It is also possible for processes to return informational return statuses that indicate various forms of success. For example, a program that modified all files in a directory may return a nonzero value to say that there were no files to modify.

You should check the application documentation to see if anything is mentioned about which values ​​can be returned. If you cannot find anything, you must empirically decide which values ​​indicate success.

+7
source

, - : , .

MSDOS , errorlevel - .

, , VMS/OpenVMS. , .

+4

All Articles