How to know in a END block whether the program died?

Viewed 93

Is it possible to know within an END block, if the program died? In Perl I would do this

END {
    if ( $? == 255 ) {
        # ...
    }
}
1 Answers

Good question!

There's none that I know of. That is why I created a Pull Request to make the following possible:

END {
    unless $*DIED-NATURALLY {
        # do special cleanup actions
    }
}
Related