Autor Thema: Logfile filled with PERL WARNING: Useless use of string eq in void context  (Gelesen 260 mal)

Offline xypzo

  • New Member
  • *
  • Beiträge: 19
Hi,
As I am a complete n00b, I have no idea what this means. I do not “speak” perl, so if you have a way to stop this annoying message, please help in the simpelest way possible  :-[

Thnx

2019.05.07 10:55:02 1: PERL WARNING: Useless use of string eq in void context at (eval 21358) line 1.
2019.05.07 10:55:52 1: PERL WARNING: Useless use of string eq in void context at (eval 21361) line 1.
2019.05.07 10:56:25 1: PERL WARNING: Useless use of string eq in void context at (eval 21372) line 1.
2019.05.07 10:56:58 1: PERL WARNING: Useless use of string eq in void context at (eval 21375) line 1.
2019.05.07 10:57:11 1: PERL WARNING: Useless use of string eq in void context at (eval 21380) line 1.
2019.05.07 10:57:42 1: PERL WARNING: Useless use of string eq in void context at (eval 21383) line 1.
2019.05.07 10:58:59 1: PERL WARNING: Useless use of string eq in void context at (eval 21399) line 1.
2019.05.07 10:58:59 1: PERL WARNING: Useless use of string eq in void context at (eval 21400) line 1.
2019.05.07 10:58:59 1: PERL WARNING: Useless use of string eq in void context at (eval 21401) line 1.
2019.05.07 10:58:59 1: PERL WARNING: Useless use of string eq in void context at (eval 21402) line 1.
2019.05.07 10:58:59 1: PERL WARNING: Useless use of string eq in void context at (eval 21403) line 1.
2019.05.07 10:59:24 1: PERL WARNING: Useless use of string eq in void context at (eval 21412) line 1.
2019.05.07 10:59:24 1: PERL WARNING: Useless use of string eq in void context at (eval 21413) line 1.
2019.05.07 10:59:24 1: PERL WARNING: Useless use of string eq in void context at (eval 21414) line 1.
2019.05.07 10:59:24 1: PERL WARNING: Useless use of string eq in void context at (eval 21415) line 1.
2019.05.07 10:59:24 1: PERL WARNING: Useless use of string eq in void context at (eval 21416) line 1.
2019.05.07 11:00:15 1: PERL WARNING: Useless use of string eq in void context at (eval 21426) line 1.
2019.05.07 11:00:15 1: PERL WARNING: Useless use of string eq in void context at (eval 21427) line 1.
2019.05.07 11:00:15 1: PERL WARNING: Useless use of string eq in void context at (eval 21428) line 1.
2019.05.07 11:00:15 1: PERL WARNING: Useless use of string eq in void context at (eval 21429) line 1.
2019.05.07 11:00:16 1: PERL WARNING: Useless use of string eq in void context at (eval 21430) line 1.
2019.05.07 11:00:48 1: PERL WARNING: Useless use of string eq in void context at (eval 21435) line 1.
2019.05.07 11:01:21 1: PERL WARNING: Useless use of string eq in void context at (eval 21442) line 1.
2019.05.07 11:01:42 1: PERL WARNING: Useless use of string eq in void context at (eval 21452) line 1.
2019.05.07 11:03:16 1: PERL WARNING: Useless use of string eq in void context at (eval 21462) line 1.
2019.05.07 11:03:16 1: PERL WARNING: Useless use of string eq in void context at (eval 21463) line 1.
2019.05.07 11:03:16 1: PERL WARNING: Useless use of string eq in void context at (eval 21464) line 1.
2019.05.07 11:03:16 1: PERL WARNING: Useless use of string eq in void context at (eval 21465) line 1.
2019.05.07 11:03:16 1: PERL WARNING: Useless use of string eq in void context at (eval 21466) line 1.
2019.05.07 11:03:33 1: PERL WARNING: Useless use of string eq in void context at (eval 21470) line 1.
« Letzte Änderung: 09 Mai 2019, 10:07:06 von xypzo »

Offline xypzo

  • New Member
  • *
  • Beiträge: 19

Offline betateilchen

  • Developer
  • Hero Member
  • ****
  • Beiträge: 16025
  • s/fhem\.cfg/configDB/g
attr global stacktrace 1
will show more useful informations in the log.
-----------------------
Unaufgeforderte Anfragen per email werden von mir nicht beantwortet. Dafür ist das Forum da.
-----------------------
Nächster Hamburg Stammtisch am 20.09.2019

Offline xypzo

  • New Member
  • *
  • Beiträge: 19
So here is some more information. I have 2 “eq” lines in my config, in a DOIF and in a NOTIFY.
Both are necessary, i guess.

define BadkamerMotion DOIF ([05:00-23:00] and [BadkamerLicht:"off"] and [BadkamerSensor:tripped9] eq "on") (set BadkamerLicht dim 70) DOELSEIF ([23:01-04:59] and [BadkamerLicht:"off"] and [BadkamerSensor:tripped9] eq "on") (set BadkamerLicht dim 25)
(The Tripped9 is a mysensors motion sensor)

Please help! My logfile needs to be deleted daily! Even with verbose on 1 haha


2019.05.15 10:25:58 1: PERL WARNING: Useless use of string eq in void context at (eval 894) line 1.
2019.05.15 10:25:58 1: stacktrace:
2019.05.15 10:25:58 1:     main::__ANON__                      called by (eval 894) (1)
2019.05.15 10:25:58 1:     (eval)                              called by ./FHEM/33_readingsGroup.pm (357)
2019.05.15 10:25:58 1:     main::lookup2                       called by ./FHEM/33_readingsGroup.pm (1395)
2019.05.15 10:25:58 1:     main::readingsGroup_Notify          called by fhem.pl (3749)
2019.05.15 10:25:58 1:     main::CallFn                        called by fhem.pl (3669)
2019.05.15 10:25:58 1:     main::DoTrigger                     called by fhem.pl (4730)
2019.05.15 10:25:58 1:     main::readingsEndUpdate             called by fhem.pl (4912)
2019.05.15 10:25:58 1:     main::readingsSingleUpdate          called by ./FHEM/10_MYSENSORS_DEVICE.pm (692)
2019.05.15 10:25:58 1:     (eval)                              called by ./FHEM/10_MYSENSORS_DEVICE.pm (690)
2019.05.15 10:25:58 1:     MYSENSORS::DEVICE::onSetMessage     called by ./FHEM/00_MYSENSORS.pm (354)
2019.05.15 10:25:58 1:     MYSENSORS::onSetMsg                 called by ./FHEM/00_MYSENSORS.pm (305)
2019.05.15 10:25:58 1:     MYSENSORS::Read                     called by fhem.pl (3749)
2019.05.15 10:25:58 1:     main::CallFn                        called by fhem.pl (748)
2019.05.15 10:25:58 1: PERL WARNING: Useless use of string eq in void context at (eval 894) line 1.
2019.05.15 10:25:58 1: stacktrace:
2019.05.15 10:25:58 1:     main::__ANON__                      called by (eval 894) (1)
2019.05.15 10:25:58 1:     (eval)                              called by ./FHEM/33_readingsGroup.pm (357)
2019.05.15 10:25:58 1:     main::lookup2                       called by ./FHEM/33_readingsGroup.pm (1395)
2019.05.15 10:25:58 1:     main::readingsGroup_Notify          called by fhem.pl (3749)
2019.05.15 10:25:58 1:     main::CallFn                        called by fhem.pl (3669)
2019.05.15 10:25:58 1:     main::DoTrigger                     called by fhem.pl (4730)
2019.05.15 10:25:58 1:     main::readingsEndUpdate             called by fhem.pl (4912)
2019.05.15 10:25:58 1:     main::readingsSingleUpdate          called by ./FHEM/10_MYSENSORS_DEVICE.pm (692)
2019.05.15 10:25:58 1:     (eval)                              called by ./FHEM/10_MYSENSORS_DEVICE.pm (690)
2019.05.15 10:25:58 1:     MYSENSORS::DEVICE::onSetMessage     called by ./FHEM/00_MYSENSORS.pm (354)
2019.05.15 10:25:58 1:     MYSENSORS::onSetMsg                 called by ./FHEM/00_MYSENSORS.pm (305)
2019.05.15 10:25:58 1:     MYSENSORS::Read                     called by fhem.pl (3749)
2019.05.15 10:25:58 1:     main::CallFn                        called by fhem.pl (748)
2019.05.15 10:25:58 1: PERL WARNING: Useless use of string eq in void context at (eval 894) line 1.
2019.05.15 10:25:58 1: stacktrace:
2019.05.15 10:25:58 1:     main::__ANON__                      called by (eval 894) (1)
2019.05.15 10:25:58 1:     (eval)                              called by ./FHEM/33_readingsGroup.pm (357)
2019.05.15 10:25:58 1:     main::lookup2                       called by ./FHEM/33_readingsGroup.pm (1395)
2019.05.15 10:25:58 1:     main::readingsGroup_Notify          called by fhem.pl (3749)
2019.05.15 10:25:58 1:     main::CallFn                        called by fhem.pl (3669)
2019.05.15 10:25:58 1:     main::DoTrigger                     called by fhem.pl (4730)
2019.05.15 10:25:58 1:     main::readingsEndUpdate             called by fhem.pl (4912)
2019.05.15 10:25:58 1:     main::readingsSingleUpdate          called by ./FHEM/10_MYSENSORS_DEVICE.pm (692)
2019.05.15 10:25:58 1:     (eval)                              called by ./FHEM/10_MYSENSORS_DEVICE.pm (690)
2019.05.15 10:25:58 1:     MYSENSORS::DEVICE::onSetMessage     called by ./FHEM/00_MYSENSORS.pm (354)
2019.05.15 10:25:58 1:     MYSENSORS::onSetMsg                 called by ./FHEM/00_MYSENSORS.pm (305)
2019.05.15 10:25:58 1:     MYSENSORS::Read                     called by fhem.pl (3749)
2019.05.15 10:25:58 1:     main::CallFn                        called by fhem.pl (748)
« Letzte Änderung: 15 Mai 2019, 10:59:02 von xypzo »

Offline xypzo

  • New Member
  • *
  • Beiträge: 19
EDIT, I found the code, just can’t seem to find the EQ that is causing the error

Temperatures valueStyle { if($READING eq "temp_c","temperature(1|2|3|4|5|6|7|8|9|0)" && $VALUE > 25){ 'style="color:red"' }elsif($READING eq "temp_c","temperature(1|2|3|4|5|6|7|8|9|0)" && $VALUE <= 19){ 'style="color:blue"' }elsif($READING eq "temp_c","temperature(1|2|3|4|5|6|7|8|9|0)" && $VALUE > 19 ){ 'style="color:green;;;;;;;;font-weight:bold"' }else{ 'style="color:gray"' } }

Offline amenomade

  • Hero Member
  • *****
  • Beiträge: 4049
What should that mean:if($READING eq "temp_c","temperature(1|2|3|4|5|6|7|8|9|0)"?
FHEM 5.8 Pi 3, EchoDot, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, und HM Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten

Offline xypzo

  • New Member
  • *
  • Beiträge: 19
It means if the reading = “temp_c” (from weather) or temperature1, temperature2 temperature3 (from mysensors) etc.
It worked, my readings were blue or red or gray, just the logfile filled up with this message...
« Letzte Änderung: 20 Mai 2019, 10:42:04 von xypzo »

Offline amenomade

  • Hero Member
  • *****
  • Beiträge: 4049
Well... I don't know how it worked, but the coma in the middle and an eq statement with regex is no Perl...
I'd write it so:
if ($READING =~ m/temp(_c|erature[\d])/or
if ($READING eq "temp_c" or $READING =~ m/temperature(1|2|3|4|5|6|7|8|9|0)/)
FHEM 5.8 Pi 3, EchoDot, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, und HM Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten