2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

98_JsonMod.pm: fix unknown warning category for perl < 5.22

git-svn-id: https://svn.fhem.de/fhem/trunk@21485 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
herrmannj 2020-03-22 23:13:18 +00:00
parent a5b7be7cbf
commit 96d46401ba

View File

@ -60,6 +60,9 @@ sub JsonMod_Initialize {
#$hash->{'NotifyOrderPrefix'} = "50-";
$hash->{'AttrList'} = join(' ', @attrList)." $readingFnAttributes ";
print "version1 $] \n" if ($] >= 5.22);
print "version2 $] \n" if ($] >= 5.28);
return undef;
};
@ -271,7 +274,7 @@ sub JsonMod_DoReadings {
};
my sub jsonPathf {
no warnings qw( redundant missing );
eval 'no warnings qw( redundant missing )' if ($] >= 5.22);
my ($jsonPathExpression, $format) = @_;
$format //= '%s';
my $value = $path->get($jsonPathExpression)->getResultValue();
@ -542,7 +545,7 @@ sub JsonMod_ApiResponse {
sub JsonMod_Logger {
my ($hash, $verbose, $message, @args) = @_;
my $name = $hash->{'NAME'};
no warnings qw( redundant missing );
eval 'no warnings qw( redundant missing )' if ($] >= 5.22);
Log3 ($name, $verbose, sprintf('[%s] '.$message, $name, @args));
return;
};