DrWhy has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting around $? setting in END blocks
by cfreak (Chaplain) on Aug 26, 2004 at 02:39 UTC | |
by DrWhy (Chaplain) on Aug 26, 2004 at 14:21 UTC | |
|
Re: Getting around $? setting in END blocks
by ikegami (Patriarch) on Aug 26, 2004 at 05:21 UTC | |
|
Re: Getting around $? setting in END blocks
by PodMaster (Abbot) on Aug 26, 2004 at 04:57 UTC | |
by fergal (Chaplain) on Aug 26, 2004 at 22:34 UTC | |
|
Re: Getting around $? setting in END blocks
by ambrus (Abbot) on Aug 26, 2004 at 14:06 UTC | |
|
Re: Getting around $? setting in END blocks
by adrianh (Chancellor) on Aug 26, 2004 at 13:12 UTC |