Don't ask to ask, just ask | |
PerlMonks |
Re^2: exit or die in error handling?by Thilosophy (Curate) |
on Apr 15, 2005 at 01:10 UTC ( [id://448036]=note: print w/replies, xml ) | Need Help?? |
They both end the program,
I think the most important difference is that die can be caught by an eval (it is Perl's way of doing exceptions) in other parts of the program, so it does not necessarily end the program. Using die thus makes code more easily reusable, and is a good habit to get into.
In Section
Seekers of Perl Wisdom
|
|