Autor Thema: Use of uninitialized value in concatenation (.) or string at ./FHEM/10_IT.pm  (Gelesen 153 mal)

Offline vbs

  • Hero Member
  • *****
  • Beiträge: 2177
Hi Ihr,

ich hab hier regelmäßig diese Warning:

2019.04.12 22:13:10.883 1: PERL WARNING: Use of uninitialized value $evcode in concatenation (.) or string at ./FHEM/10_IT.pm line 775.
2019.04.12 22:13:10.883 1: stacktrace:
2019.04.12 22:13:10.883 1:     main::__ANON__                      called by ./FHEM/10_IT.pm (775)
2019.04.12 22:13:10.883 1:     main::IT_Define                     called by fhem.pl (3704)
2019.04.12 22:13:10.883 1:     main::CallFn                        called by fhem.pl (2063)
2019.04.12 22:13:10.883 1:     main::CommandDefine                 called by fhem.pl (1229)
2019.04.12 22:13:10.883 1:     main::AnalyzeCommand                called by fhem.pl (1082)
2019.04.12 22:13:10.884 1:     main::AnalyzeCommandChain           called by fhem.pl (1370)
2019.04.12 22:13:10.884 1:     main::CommandInclude                called by fhem.pl (599)

Lösung ist wohl hier in dem Code:
    #Log3 $hash,2,"ITdefine 1527: $name a3=" . $a[3];
    $housecode = $a[2];
    if (substr($housecode,0,4) eq '1527') {
      my $evcode;

Das
      my $evcode;
in
      my $evcode = "";
zu ändern.

Ähnliches Muster wie hier mMn:
https://forum.fhem.de/index.php/topic,95217.0.html