This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
clarify how $SIG{__DIE__} can return
authorDavid Mitchell <davem@iabyn.com>
Sun, 8 Jan 2012 15:45:39 +0000 (15:45 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sun, 8 Jan 2012 15:45:39 +0000 (15:45 +0000)
It can return via 'goto &sub', but not via 'goto LABEL'.
The docs originally just said 'via goto'

See [perl #44367].

pod/perlvar.pod

index 1727c6d..61ad1a9 100644 (file)
@@ -558,10 +558,10 @@ The routine indicated by C<$SIG{__DIE__}> is called when a fatal
 exception is about to be thrown.  The error message is passed as the
 first argument.  When a C<__DIE__> hook routine returns, the exception
 processing continues as it would have in the absence of the hook,
-unless the hook routine itself exits via a C<goto>, a loop exit, or a
-C<die()>.  The C<__DIE__> handler is explicitly disabled during the
-call, so that you can die from a C<__DIE__> handler.  Similarly for
-C<__WARN__>.
+unless the hook routine itself exits via a C<goto &sub>, a loop exit,
+or a C<die()>.  The C<__DIE__> handler is explicitly disabled during
+the call, so that you can die from a C<__DIE__> handler.  Similarly
+for C<__WARN__>.
 
 Due to an implementation glitch, the C<$SIG{__DIE__}> hook is called
 even inside an C<eval()>.  Do not use this to rewrite a pending