$Threscount=0; open(THRESHOLDS, "$Thresholds") or die("Could not open Thresholds file."); foreach () { chomp($_); if ($_ =~/^(\w+);(\d+);$/ && $_ !~/^\#/) { print "DEBUG: use constant $1 => $2;\n"; use constant $1 => $2; log_msg("Setting: use constant $1 => $2;"); if ($Threslabels[$Threscount] ne $1) { log_msg("There is something wrong with the thresholds labels, check thresholds file!"); exit(2); } $Threscount++; } } if ($Threscount != 8) { print "$Threscount\n"; log_msg("Wrong number of thresholds they should be 8 there are $Threscount"); exit(2); } close(THRESHOLDS);