I do have a partial solution. When my own __DIE__ handler is being called (but I think I cannot guarantee that), then the runtime error will have no caller() info.
So, when the eval'ed code does not mess with the __DIE__ handler, I can differentiate the three:
my $cause = 'PARSER'; eval { local $SIG{__DIE__} = sub { $cause = caller ? 'EXPLICIT' : 'INTERNAL'}; $do_something(); }; print $cause if $@;
Now a solution without the volatile __DIE__
In reply to Re: why did i die?
by markov
in thread why did i die?
by markov
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |