Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Re x 2: How to end a Perl scriptby dws (Chancellor) |
on May 03, 2002 at 07:24 UTC ( [id://163725]=note: print w/replies, xml ) | Need Help?? |
Using die when everything went right in your Perl program may trigger unexpected behaviour in your calling program.
If I exit from within a script (as opposed to falling off the end), then something went wrong, and die() is the right thing to do. Using exit() from anywhere down the call stack is kind of like using a goto. I try not to do it. Using a die() from within an eval block is different, since that's the equivalent of throwing an exception.
In Section
Seekers of Perl Wisdom
|
|