if($map_Cmin >= 0 and $map_Cmin >= 0 and $title_row >= 0){ for(my $iR = $title_row +1; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++){ $internal_cell = $oWkS->{Cells}[$iR][$map_Cmin]; $active_cell = $oWkS->{Cells}[$iR][$active_col]; $family_cell = $oWkS->{Cells}[$iR][$family_col]; if(defined $internal_cell and defined $active_cell and defined $family_cell and length(decode('cp1252',$internal_cell->{Val})) gt 0 and !(length(decode('cp1252',$active_cell->{Val})) gt 0) and length(decode('cp1252',$family_cell->{Val})) gt 0)