One way is if you use the signal $SIG{__DIE__}, you can provide your own subroutine to acomplish this when die is called. Read more on "How do I trap control characters/signals?" for more information.
Beware signals..
It's quite possible that the signal being handled at a 'bad time' will actually cause the process to segfault, which is worse than the initial behaviour that's being circumvented.