FHEM Forum

FHEM => Sonstiges => Thema gestartet von: Nestor am 10 November 2019, 19:24:05

Titel: 70_VIERA.pm: PERL WARNING: Use of uninitialized value in numeric gt
Beitrag von: Nestor am 10 November 2019, 19:24:05
I have following error in Fhem log.
2019.11.10 00:07:16 1: PERL WARNING: Use of uninitialized value in numeric gt (>) at ./FHEM/70_VIERA.pm line 426.


Since read (https://perldoc.perl.org/functions/read.html) can also return undef upon error, maybe this can be validated?

--- - 2019-11-10 19:10:42.000000000 +0100
+++ FHEM/70_VIERA.pm 2019-11-10 19:08:54.000000000 +0100
@@ -423,7 +423,9 @@
     Log3 $hash, 5, "VIERA[$blocking]: Send Data to $hash->{helper}{HOST}:$hash->{helper}{PORT}:\n$data";
     print $sock $data;
   
-    while ((read $sock, $buff, 1024) > 0){
+    while (1){
+      my $res = read $sock, $buff, 1024;
+      last if (not defined($res) or $res == 0);
       $buffer .= $buff;
     }
Titel: Antw:70_VIERA.pm: PERL WARNING: Use of uninitialized value in numeric gt
Beitrag von: mabula am 02 Januar 2020, 13:47:03
Hi Nestor,
have you still problems with the newer versions of this module?
If yes, please send me a note directly.

regards
HJB
Titel: Antw:70_VIERA.pm: PERL WARNING: Use of uninitialized value in numeric gt
Beitrag von: mabula am 03 Januar 2020, 21:47:05
Thank you Nestor,

Good remark. I will implement it at the next update. I just work on new commands, starting "apps" directly. If you have a TV without encryption would you mind to help testing. I have only one with encryption and I must change code more radical.

Regards
HJB
Titel: Antw:70_VIERA.pm: PERL WARNING: Use of uninitialized value in numeric gt
Beitrag von: Nestor am 04 Januar 2020, 10:11:00
I don't have a newer Viera with encryption unfortunately, only older plasma VT50 series.
Titel: Antw:70_VIERA.pm: PERL WARNING: Use of uninitialized value in numeric gt
Beitrag von: mabula am 04 Januar 2020, 14:40:31
That's exactly what I'm looking for. Would you mind to test an the old TV version? I have only a new one.
Titel: Antw:70_VIERA.pm: PERL WARNING: Use of uninitialized value in numeric gt
Beitrag von: Nestor am 04 Januar 2020, 15:13:06
Running r.20776, no issues encountered  ;)
Titel: Antw:70_VIERA.pm: PERL WARNING: Use of uninitialized value in numeric gt
Beitrag von: mabula am 04 Januar 2020, 15:38:19
Sorry Nestor,
you have been too fast. I will put the new Version just for testing in the thread https://forum.fhem.de/index.php/topic,99994.0.html.
I changed the commands completely (internal hashes) and using a common command path for encrypted and non-encrypted TVs.
So I have to know, if I have not destroyed everything with older TVs.
I will send you a direct mail, after upload the new version.

Greatings
HJB