On Fri Aug 31 09:11:00 2007, powerman@powerman.asdfGroup.com wrote: > In this case 'goto' doesn't work properly, and instead of jumping to > the > label, it work like 'die' and jump to the first command after 'eval': > > perl -e ' > BEGIN { > *CORE::GLOBAL::exit = sub { > goto FASTCGI_NEXT_REQUEST; > }; > } > while (1) { > eval { that_cgi_script() }; > FASTCGI_NEXT_REQUEST: > last; > } > > sub that_cgi_script { > local $SIG{__DIE__} = sub { print "<p>error: $_[0]"; exit; print > "XXX\n" }; > print "before buggy code\n"; > eval { buggy_code() }; > print "after buggy code\n"; > } > sub buggy_code { > die "error!"; > print "after die\n"; > } > ' > > This example output: > > before buggy code > <p>error: error! at -e line 20. > after buggy code Exiting a signal handler via goto is not supported. goto() can’t see the label, which causes an error that is caught by the eval. This is related to bug #44367. If errors in signal handlers work, why not goto?