From 8715a70cec35b70b2a71101594975e5ff6a18ad9 Mon Sep 17 00:00:00 2001 From: Alessandro Battilani Date: Tue, 19 Jan 2021 23:10:32 +0100 Subject: [PATCH] miglioramenti mail di errore/warning --- LoadCSVData.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LoadCSVData.pl b/LoadCSVData.pl index a64d011..cdd9e4f 100755 --- a/LoadCSVData.pl +++ b/LoadCSVData.pl @@ -60,6 +60,11 @@ my @warnings; my $MatlabErrors = ''; my $MatlabWarnings = ''; +sub uniq { + my %seen; + grep !$seen{$_}++, @_; +} + sub getTimeStamp { # parm [ts] => timestamp for filename; log => timestamp for log my $format = "%04d%02d%02d%02d%02d%02d"; @@ -144,7 +149,7 @@ sub matlabCalc { @errors = grep( /^Error/, @matlabOutputErrorArray ); @warnings = grep( !/^Error/, @matlabOutputErrorArray ); $MatlabErrors = join( "
", @errors ); - $MatlabWarnings = join( "
", @warnings ); + $MatlabWarnings = join( "
", uniq(@warnings) ); my $exit_value = $? >> 8; if ( $exit_value == 124 ) {