P is for Practical | |
PerlMonks |
Re x 2: How to end a Perl scriptby Sweeper (Pilgrim) |
on May 03, 2002 at 05:21 UTC ( [id://163713]=note: print w/replies, xml ) | Need Help?? |
I rarely embed an exit(),
favoring die() instead.
The purpose of die is to report an error to the calling program, and the exit code is not zero. Using die when everything went right in your Perl program may trigger unexpected behaviour in your calling program. Imagine for instance using your program in a makefile. The make process would end immediately, and you would not know why.
In Section
Seekers of Perl Wisdom
|
|