in reply to die through several evals
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: die through several evals
by nyaapa (Novice) on Apr 24, 2013 at 08:59 UTC | |
by kennethk (Abbot) on Apr 24, 2013 at 17:59 UTC |