I can't check $@ or override eval function to propagate die.Why can't you check $@? This sounds like an artificial constraint. Why can't you simply branch and die if the eval fails, e.g.
local $SIG{ALRM} = sub{die "Timeout hit\n"}; eval { eval { magick_die; }; if ($@ and $@ eq "Timeout hit\n") { die $@; } };
You could also fork and run the alarm in the parent thread. Then it really doesn't matter what the flow in the child is.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re: die through several evals
by kennethk
in thread die through several evals
by nyaapa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |