in reply to Eval not catching Dies

I'd first check that dieing out of an eval still gives the two locals a chance to do their "undo" magic. Even if it does, this "undo" magic may well be happening outside of the eval's protection against die, giving you a race condition.

You could probably even write some test code such that the local undo causes something to be destroyed which dies which should demonstrate whether you are still inside of eval's protection.

sub DESTROY { warn "Destroying $_[0][0]...\n"; die "Die from $_[0][0]\ +n" } $global= "before"; eval {{ local $global= bless ["global"]; die "Die inside eval.\n" unless @ARGV; }}; warn "global($global) eval($@)\n";
which, if @ARGV is empty, produces:
Destroying global... global(before) eval(Die inside eval. (in cleanup) Die from global )

which seems to indicate that my version of Perl is handling this case correctly.

                - tye