New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eval{ local $tied } does not catch the error #11797
Comments
From @cpansproutI was a little buffled when I added eval{} to debug a fatal statement and the eval failed to catch the error. It turns out that localisation that fails (due to a missing STORE method) will already have half-localised the variable, such that the unwinding of the eval scope will trigger another STORE, which will die and exit the next outer eval scope. So eval{eval{ local $tied }} catches the error. Localisation that fails obviously(?) shouldn’t half-happen, but should scope unwinding in general suppress errors that occur during STORE? I don’t know which parts of perl need fixing. Maybe this is a won’t-fix. Or a useful feature. package Acme::Multidie; @EXPORT = multidie=>; sub TIESCALAR{ shift; bless \@_ } sub multidie { package main; import Acme'Multidie; eval { __END__ Here’s a test case: Inline Patch
Site configuration information for perl 5.15.5: Configured by sprout at Sat Nov 26 11:40:22 PST 2011. Summary of my perl5 (revision 5 version 15 subversion 5) configuration: Locally applied patches: @INC for perl 5.15.5: Environment for perl 5.15.5: |
From @cpansproutOn Sun Dec 11 13:13:28 2011, sprout wrote:
I suspect the correct fix is to use setjmp in leave_scope. But setjmp -- Father Chrysostomos |
From [Unknown Contact. See original ticket]On Sun Dec 11 13:13:28 2011, sprout wrote:
I suspect the correct fix is to use setjmp in leave_scope. But setjmp -- Father Chrysostomos |
@cpansprout - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#105916 (status was 'open')
Searchable as RT105916$
The text was updated successfully, but these errors were encountered: