Subject: | END { ... } block destroys exit value. |
Error in Attribute-Handlers-0.78, file Attribute/Handlers.pm, line 210.
The END block:
END { $global_phase++; _apply_handler_AH_($_,'END') foreach @declarations }
does not preserve $?, and results in an exit value of 255 whatever the user specified in the exit() call.
The fix is to change the block to read something like:
END { my $exitval = $?; $global_phase++; _apply_handler_AH_($_,'END') foreach @declarations; $? = $exitval }