package Error; use Exporter (); @ISA = qw(Exporter); @EXPORT = qw( csWarn csDie ); use lib 'f:/projects/site/bin/config/'; use strict; use utf8; use csLogsConfig; #================================================== # Replacements for User-called warn and die #-------------------------------------------------- # to be used instead of warn() in application code sub csWarn { takes error class/severity and diagnostics info as parameters . . . } #-------------------------------------------------- # to be used instead of die() in application code sub csDie { very similar to csWarn, except that it exit()'s on completion . . . } #================================================== # Private Functions . . . #================================================== #Overload SIGWARN and SIGDIE BEGIN { sub csWarnHandle { much like csWarn except with default parameters } sub csDieHandle { much like csDie except with default parameters } $SIG{__WARN__} = \&csWarnHandle; $SIG{__DIE__} = \&csDieHandle; } #---- 1;