my ($n, $m, $o) = $s1 =~ /^(PD|WGA_PD)(\d+)(a|b|c)/; 155 my ($n1, $m1, $o1) = $matSam->{ sample } =~ /^(PD|WGA_PD)(\d+)(a|b|c)/; and comparing the $m ==$m1 and also /(\w+)(a|b|c). and comparing the $1 of one sample with the other. But surely, I am making some stupid mistakes. as they still do come in the LOG file.