From: Mischa POSLAWSKY Date: Thu, 27 Apr 2017 01:20:59 +0000 (+0200) Subject: common: early setup of plp error formatting X-Git-Tag: v1.10~56 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/ff4a38aff3e2d22ef34e33cd5df7a16d8ceeb196 common: early setup of plp error formatting Load at BEGIN to catch compile-time errors. --- diff --git a/common.inc.plp b/common.inc.plp index 6b45e50..d7e2b79 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -20,15 +20,15 @@ sub Alert { say "
$body
\n"; } -$PLP::ERROR = sub { - my ($text, $html) = @_; - Alert("Fatal error: $html."); - warn $text; -}; - BEGIN { require Time::HiRes; our $Time = [Time::HiRes::gettimeofday()]; + + $PLP::ERROR = sub { + my ($text, $html) = @_; + warn $text; + Alert("Fatal error: $html."); + }; } # user request