1 2 3 4 5 6 7 8 9 10
my $what_happened; eval{ local $SIG{__DIE__} = sub { $what_happened = shift; }; die "I am not dead yet"; print "I will not be executed"; }; print STDERR qq(what_happend = '$what_happened'\n); die "normally";
1 2 3
what_happend = 'I am not dead yet at line 6. ' normally at line 10.