I want to use Log::Dispatch to log activity using a number of methods (screen, files, e-mail, etc).
If I encounter a certain error threashold (such as 'critical') I want the script to also "die". I would like Log::Dispatch to handle this for me anytime it dispatches a "critical" level error message.
I don't see a good way to do this. I could, prehaps, define a "critical" method which will "die" via a callback (as shown in my example below). But, besides being an ugly kludge, there's a functional problem with this (which I explain after this code):