while (){ my @line = split (/\t/,$_); ## tab separated file my @tmp = split(/\./,$line[1]); ## chromosome name in field 2, as part of a dot separated string $chr{"$tmp[1]"} = new Set::IntervalTree() unless (defined $chr{"$tmp[1]"}); $chr{"$tmp[1]"} -> insert($count,$line[2]-1,$line[3]+1); ## fields 3 and 4 contain the coordinates, -1 and +1 to allow search for direct overlaps at start and end }