summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2017-12-09 16:03:17 +0100
committerYorhel <git@yorhel.nl>2017-12-09 16:03:20 +0100
commit3ce081167e7b6a19937ec1756578f853866cd1fb (patch)
tree3eebc6adbed7dd8d3386459b681821e57cfba792 /lib
parent416bfc2c964c1c89196f39753e698a2496f4131e (diff)
Use "local" to disable $SIG{__WARN__} in log handler
Just a minor cleanup.
Diffstat (limited to 'lib')
-rw-r--r--lib/TUWF.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/TUWF.pm b/lib/TUWF.pm
index f6b8f09..4b65472 100644
--- a/lib/TUWF.pm
+++ b/lib/TUWF.pm
@@ -368,8 +368,7 @@ sub log {
# temporarily disable the warnings-to-log, to avoid infinite recursion if
# this function throws a warning.
- my $old = $SIG{__WARN__};
- $SIG{__WARN__} = undef;
+ local $SIG{__WARN__} = undef;
chomp $msg;
$msg =~ s/\n/\n | /g;
@@ -384,7 +383,6 @@ sub log {
}
# Also always dump stuff to STDERR if we're running a standalone HTTP server.
warn $msg if $self->{_TUWF}{http};
- $SIG{__WARN__} = $old;
}