From 4136991831a0066a1da08ec4c3320431b40c195c Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Thu, 17 Jan 2019 15:30:13 +0000 Subject: [PATCH] betateilchen: debug code git-svn-id: https://svn.fhem.de/fhem/trunk@18300 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/betateilchen/debug/configDB.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/fhem/contrib/betateilchen/debug/configDB.pm b/fhem/contrib/betateilchen/debug/configDB.pm index cf4a4fc81..37ec80c9f 100644 --- a/fhem/contrib/betateilchen/debug/configDB.pm +++ b/fhem/contrib/betateilchen/debug/configDB.pm @@ -205,16 +205,18 @@ sub _cfgDB_dump($); # -my ($err,@config); - -($err,@config) = FileRead({FileName => 'configDB.conf', +my ($err,@c) = FileRead({FileName => 'configDB.conf', ForceType => "file"}); - return 0 if ($err); -@config = map { $_ =~ s/^\s+|\s+$//g; } @config; -@config = map { $_ =~ s/;$/;;/;} @config; -@config = map { $_ ? $_ : (); } @config; +my @config; + +foreach my $line (@c) { + $line =~ s/^\s+|\s+$//g; # remove whitespaces etc. + $line =~ s/;$/;;/; # duplicate ; at end-of-line + push (@config,$line) if($line !~ m/^#/ && length($line) > 0); +} + use Data::Dumper; print Dumper @config;