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.
which, if @ARGV is empty, produces: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";
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.
In reply to Re: Eval not catching Dies (local)
by tye
in thread Eval not catching Dies
by jdhedden
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |