die: outputs stderr then exit and also it can trap errors by evalexit: just exits or exit with EXPR
Login to rate this answer.
die("couldnot open filen"); ---> terminate the program with customized message.
die -> terminates with last system error message.
exit(0) or exit; for success
exit(1); failure
die function never accepts number as argument.It always accepts string or nothing.
die function always terminate prgram with error message wheras exit just terminates

1 User has rated as useful.
Login to rate this answer.
1) die is used to throw an exception (catchable using eval).
exit is used to exit the process.
2) die will set the error code based on $! or $? if the exception is uncaught.
exit will set the error code based on its argument.
3) die outputs a message
exit does not.

4 Users have rated as useful.
Login to rate this answer.
felix
Answered On : Nov 21st, 2011
There is not same it must be difference . I am sure it must difference but same action perform.but returning a value difference may be like string variable what ever may be
Login to rate this answer.
vasava pv
Answered On : Oct 7th, 2012
die function was print a error message and exit function does not ... Otherwise both are same functionality
Login to rate this answer.