FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: xsnobby am 08 August 2016, 15:27:37

Titel: PERL WARNING: Smartmatch is experimental at (eval xxxx) line 1.
Beitrag von: xsnobby am 08 August 2016, 15:27:37
Hallo,

ich habe im log folgende Meldungen:
PERL WARNING: Smartmatch is experimental at (eval xxxx) line 1. 

Leider finde ich im Netz keinen Hinweis wo genau das Problem ist.
FHEM und die Module sind aktuell
Fhem info:
  Release  : 5.7 FeatureLevel: 5.7
  OS       : linux
  Arch     : arm-linux-gnueabihf-thread-multi-64int
  Perl     : v5.20.2

Folende Module werden genutzt:
Defined modules:
  CUL            : 1
  CUL_HM         : 70
  CUL_WS         : 1
  DOIF           : 5
  DbLog          : 1
  EGPM           : 4
  EGPM2LAN       : 1
  ENIGMA2        : 1
  FHEM2FHEM      : 2
  FHEMWEB        : 4
  FRM            : 1
  FRM_IN         : 1
  FileLog        : 54
  HMLAN          : 1
  HMinfo         : 1
  I2C_BMP180     : 1
  IT             : 33
  MQTT           : 1
  MQTT_DEVICE    : 1
  OWTHERM        : 1
  OWX_ASYNC      : 1
  PRESENCE       : 13
  PROPLANTA      : 1
  RPII2C         : 1
  SVG            : 13
  SYSMON         : 1
  allowed        : 1
  at             : 5
  autocreate     : 1
  dummy          : 6
  eventTypes     : 1
  fronthem       : 1
  fronthemDevice : 7
  logProxy       : 1
  notify         : 24
  readingsGroup  : 6
  weblink        : 2

Defined models per module:
  CUL_HM         : ActionDetector,CCU-FHEM,HM-CC-RT-DN,HM-LC-SW1-FM,HM-MOD-Em-8,HM-PB-2-WM55,HM-PB-6-WM55,HM-SEC-RHS,HM-TC-IT-WM-W-EU
  ENIGMA2        : ET9200
  IT             : itswitch
  OWTHERM        : DS18B20



Hat jemand einen Tipp wo ich suchen muss?

Danke und viele Grüße

Norbert
Titel: Antw:PERL WARNING: Smartmatch is experimental at (eval xxxx) line 1.
Beitrag von: franky08 am 08 August 2016, 15:55:21
Beispiel mit Smartmatch:

{ if(!isday() && $hour ~~ [17..24]) { fhem "set Licht_SZ on-for-timer 120" } }

umgebaut, ohne Smartmatch:
{ if(!isday() && ($hour >= 17 && $hour <= 24) { fhem "set Licht_SZ on-for-timer 120" } }

Die Meldung wird ausgegeben wenn du eine neuere Perl Version einsetzt, z.B. wenn du mit Jessie oder einer neueren Ubuntu Version arbeitest. Such mal im Forum nach smartmatch, das hat Rudi schon mal erklärt.

Such mal in einem deiner notifys oder 99_myUtils oder ähnlichen nach ~~

http://www.nerdsheaven.de/magazin/artikel/tipps-und-tricks/perl-warning-smartmatch-is-experimental/

VG
Frank
Titel: Antw:PERL WARNING: Smartmatch is experimental at (eval xxxx) line 1.
Beitrag von: betateilchen am 08 August 2016, 16:20:23
Die Meldung einfach ignorieren.
Titel: Antw:PERL WARNING: Smartmatch is experimental at (eval xxxx) line 1.
Beitrag von: xsnobby am 09 August 2016, 12:39:59
Könnte ich mit leben, aber das schreibt mir das Log voll.
Ich habe aber was in der Reading Group heatingInfo gefunden.

attr heatingInfo valueStyle {if($READING eq "measured-temp"){my $t=$VALUE;;;;my $d=ReadingsVal($DEVICE,'desired-temp',0);;;;if($t-$d>=1){'style="color:rgb(251,63,11);;;;"'}
elsif($t-$d<=-1){'style="color:rgb(79,58,251);;;;"'}else{'style="color:rgb(12,251,12);;;;"'}}
elsif($VALUE ~~ /CMDs_pending/ || $VALUE ~~ /CMDs_processing/ || $VALUE ~~ /TIMEOUT/){'style="color:Yellow"'}}


Wie muss ich das korrigieren? Meine Perl Kenntnisse sind nicht besonders umfangreich und aus dem was ich im Netz gefunden habe werde ich nicht schlau.

Viele Grüße

Norbert

Titel: Antw:PERL WARNING: Smartmatch is experimental at (eval xxxx) line 1.
Beitrag von: xsnobby am 09 August 2016, 20:18:21
Hab es gelöst. Ich habe den Teil mit den ~~ gelöscht. Der Teil ist für meine Konfiguration nicht notwendig. Ist wohl ein alter Teil.

Danke und Gruß

Norbert
Titel: Antw:PERL WARNING: Smartmatch is experimental at (eval xxxx) line 1.
Beitrag von: ahlermi am 27 Oktober 2017, 10:08:51
ab Perl 5.18:

no warnings 'experimental::smartmatch';