sub return {
return "\$context->throw('return', '', \\\$output);";
}
sub stop {
return "\$context->throw('stop', '', \\\$output);";
}
There is a long-known problem from the TODO list:
* Errors thrown via the Error module are not correctly caught. I looked
at this briefly but the problem wasn't immediately obvious and needs some
more considered investigation. There are also problems with CGI::Carp
throwing errors that don't get properly caught.
I believe the problem lies in modules (non-TT modules that is) that blindly
redefine $SIG{__DIE__} and/or $SIG{__WARN__}. Presumably, these modules
attempt to intercept all warn/die calls but don't give any consideration to
the fact that your program (or other modules) might be relying on those
calls for correct execution.
I suspect that some other module that you're using is trapping $SIG{__DIE__}
and turning a perfectly harmless RETURN into a confess().
HTH
A