in reply to Nested Evals in Old Perl 5.10
It's going back quite a while, but I think I remember a bug something along the lines of the error getting assigned to a localized $@ before it gets de-localized. Looking through the changelogs I found the section Exception handling in pod/perl5140delta.pod which states:
When an exception is thrown inside an eval, the exception is no longer at risk of being clobbered by destructor code running during unwinding. Previously, the exception was written into $@ early in the throwing process, and would be overwritten if eval was used internally in the destructor for an object that had to be freed while exiting from the outer eval. Now the exception is written into $@ last thing before exiting the outer eval, so the code running immediately thereafter can rely on the value in $@ correctly corresponding to that eval. ($@ is still also set before exiting the eval, for the sake of destructors that rely on this.)
(There's more, you should probably read the whole section to see what's relevant to your case.)
Assuming the bug fixed here is what you're seeing, it may be that you could avoid it by redesigning the inner eval to avoid local $@. But it's not clear to me if that would be enough.
|
|---|