So, I came across a PERL script while working on an already implemented project. Since its confidential, I cannot reveal much details but the code is somewhat like this :
if(defined($x)){
exit(0);
}
#...........
#.some other code.
#...........
if(!defined($y)){
print "ERROR !";
exit(1);
}
I am assuming exit(1) is in error conditions and exit(0) is for success cases. But since we are already printing the error message, what is the difference here between exit(0) and exit(1)?