From afb4f112b046a45f8f9de85fb079018a99cc66aa Mon Sep 17 00:00:00 2001 From: herrmannj <> Date: Tue, 24 Mar 2020 20:02:32 +0000 Subject: [PATCH] 98_JsonMod.pm: #109413: no warnings/ minor performance improvement git-svn-id: https://svn.fhem.de/fhem/trunk@21502 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_JsonMod.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/98_JsonMod.pm b/fhem/FHEM/98_JsonMod.pm index 4004b3fa1..011167e6a 100644 --- a/fhem/FHEM/98_JsonMod.pm +++ b/fhem/FHEM/98_JsonMod.pm @@ -276,7 +276,9 @@ sub JsonMod_DoReadings { }; my sub jsonPathf { - eval 'no warnings qw( redundant missing )' if ($] >= 5.22); + # https://forum.fhem.de/index.php/topic,109413.msg1034685.html#msg1034685 + no if $] >= 5.022, q|warnings|, qw( redundant missing ); + #eval 'no warnings qw( redundant missing )' if ($] >= 5.22); my ($jsonPathExpression, $format) = @_; $format //= '%s'; my $value = $path->get($jsonPathExpression)->getResultValue(); @@ -555,7 +557,9 @@ sub JsonMod_ApiResponse { sub JsonMod_Logger { my ($hash, $verbose, $message, @args) = @_; my $name = $hash->{'NAME'}; - eval 'no warnings qw( redundant missing )' if ($] >= 5.22); + # https://forum.fhem.de/index.php/topic,109413.msg1034685.html#msg1034685 + no if $] >= 5.022, q|warnings|, qw( redundant missing ); + #eval 'no warnings qw( redundant missing )' if ($] >= 5.22); Log3 ($name, $verbose, sprintf('[%s] '.$message, $name, @args)); return; };