perldoc -f exit says:
The exit() function does not always exit immediately. It calls any defined "END" routines first,
but these "END" routines may not themselves abort
the exit.
But the following code seems to exit() out of the END{} block (I can tell because a status code of 1 is returned to the OS):
#!/usr/bin/perl -Tw
use strict;
print "I'm going to exit now.\n";
exit(255);
sub END {
print "In END block\n";
exit(1);
}
Am I missing something simple?
As an aside: I never see exit() used. Is is best to avoid it because of the catchability of die()?
---
"A Jedi uses the Force for knowledge and defense, never for attack."