I am using syntax checking to see whether my Perl script is being used in the correct way. If the syntax is not correct, I display a message saying what the correct syntax is and then end the execution of the program.
Out of
print "Please use the following syntax: ...";
exit 1;
and
die("Please use the following syntax: ...");
which one should I use? I know die
would have been the answer if exception handling was in place. But that is not the case.
Which one is the better choice for program termination without exception handling? Please say why also.