Yes, you can also literally redefine
die using a
typeglob in a BEGIN block, but I would disagree that this is generally what one would want. If you want to prevent die from killing your script, I think it is far better to trap potential dies in
eval blocks, since you won't violate assumptions made in code you are calling (like having an
open fail and still trying to process input). If you are not calling any external code, there is (generally) no reason to be using die in the first place if you don't want to throw exceptions.
Certainly in the case of the OP, there is no indication that the exception should be prevented.