From 703165453e2e3c839e138c9a5dc766e1f77f8681 Mon Sep 17 00:00:00 2001 From: mfr69bs <> Date: Mon, 4 Feb 2013 21:43:52 +0000 Subject: [PATCH] fixed an error with perl 8.x git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2647 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/98_notice.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/FHEM/98_notice.pm b/FHEM/98_notice.pm index 0f541105b..10c974cc5 100644 --- a/FHEM/98_notice.pm +++ b/FHEM/98_notice.pm @@ -68,7 +68,7 @@ CommandNotice($$) $args[0] = "list" if(!defined($args[0])); - if(!@args || $args[0] ~~ @commands) { + if(!@args ||grep (m/^$args[0]$/, @commands)) { my $cmd = $args[0]; if($cmd eq "list") { @@ -93,15 +93,16 @@ CommandNotice($$) my $locale = "en"; my $header = 1; if(@args == 3) { - $locale = ($args[2] ~~ @locale) ? $args[2] : "en"; + $locale = (grep (m/^$args[2]$/, @locale)) ? $args[2] : "en"; + $locale = (grep (m/^$args[2]$/, @locale)) ? $args[2] : "en"; $header = ($args[2] eq "noheader") ? 0 : 1; } elsif(@args == 4) { - if($args[2] ~~ @locale) { - $locale = ($args[2] ~~ @locale) ? $args[2] : "en"; + if(grep (m/^$args[2]$/, @locale)) { + $locale = (grep (m/^$args[2]$/, @locale)) ? $args[2] : "en"; $header = ($args[3] eq "noheader") ? 0 : 1; } elsif($args[2] eq "noheader") { $header = ($args[2] eq "noheader") ? 0 : 1; - $locale = ($args[3] ~~ @locale) ? $args[3] : "en"; + $locale = (grep (m/^$args[3]$/, @locale)) ? $args[3] : "en"; } }