following on from that..but going out on a limb: i think you're trying to create/process some kind of a bookmark in text, which has starting and ending positions in text.
what you're doing with combining two values into one hash key is probably not a good idea..as it's just made your job a whole lot harder. a HoHoH works better than Ho{H.H}
also, if my assumption about the problem is in the ballpark, it's probably better to store as starting position and ending position offset (length); rather than starting position and ending position. you can always quickly calculate the ending position if absolutely necessary at a point in time, but easier to handle the thing (i think) with a start pos + length. your range tests then become rather simple.
the hardest line to type correctly is: stty erase ^H