It even includes the solution of making $? local in your END block. This won't work for me for the following reasons. I don't know where the END block is. It's buried deep in some library somewhere. This script uses currently over 100 libraries and that number is likely to grow over time. I also don't know if it's in only one place or multiple places so even if I did find one there might be others. The actual number of libraries used isn't even determined within the script itself. This script runs all the test scripts for our project (implemented within the Test::Unit framework) so as we add more modules and more tests for existing modules this is expected to grow. The END block (some of the END blocks) may well be in one of the CPAN or non-local, non-CPAN modules our modules make use of. If they aren't now then in the future one might be.
I tried to use Manip::END. Using this to push a new END block onto the list of END blocks that preserves/restoreds the desired exit value would work and be a nice local solution to this very non-local problem. But we're using 5.6.1 and Manip::END requires 5.8.0.
Anybody out there have any idea how I can get a local solution that works with 5.6.1? For instance, is it possible to get at the list of END block subroutines without Manip::END?
Much thanks!
-- DrWhy
In reply to Getting around $? setting in END blocks by DrWhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |