Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Any documentation link on perl program exit code without `exit()` statement

My boss believes that perl program without explicit exit(0) at the end may return some other value, e. g. that one returned by the last function call in the program, or may be last system call. Perhaps he confuses it with bash.
So he requires his programmers to put explicit exit(0) statement at the end of each perl script.
Simple code examples or references to existing programs cannot convince him.
Unfortunately I have no idea how to find the relevant topic in the documentation quickly: all keywords are too common.
May be someone can point out exact place in the perl documentation what is the perl program exit code when the program just reaches its end, without any die or exit. (Yes, in fact I know what it is, but I need an official confirmation).

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

perlrun covers this

If the program is syntactically correct, it is executed. If the program runs off the end without hitting an exit() or die() operator, an implicit exit(0) is provided to indicate successful completion.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading