Description:

I have a fairly complex script, which pulls in a bunch of modules. The probability of warnings being issued is fairly high. I want to stop the script even for a warning. How can I escalate a 'warn' to a 'die'?

I've tested both solutions. Note that zigdon's solution will trap warnings issued by included modules, whereas rir's solution will only affect calls to warn within the package where the sub is declared.