After reading your comments through this thread that provide more details, I think I understand your problem.
You're struggling with a particular perl problem, but I think it would be most helpful to take a step back and look at the problem as a whole.
This sounds very Buddhist Monk-like, but what you want is 'A Golden Path'. A single path that covers the entire range, but uses the fewest overlapping pieces to get there.
There are several well-understood algorithms for doing that. You might try the
Graph module, which provides access to several different ways of analyzing this problem (See Graph::Base). Understanding this involves some pretty heavy mathematics, but you essentially create a line (1D, not 2D) along which you place your points as vector pairs (the start point and the end point) Then apply one of the available algorithms to find the shortest connecting path. The same sort of algorithms are used in many other applications. (such as networking to find the fastest route connecting two nodes.)
Do a search on '
golden path algorithm' or some of the algorithms directly, such as '
dijkstra shortest path perl'. (That last one even has a few perl implementations, but the first one says 'use Graph instead'.)
Developing your own algorithm is certainly possible, but this is a much more complex problem than it first appears to be. Might as well use a well thought out and tested algorithm - you just have to understand that the same method of finding the shortest distance between two network nodes also applies to finding the fewest non-overlapping clones on a tiling path.
Sorry my reply is less perl and more theory, but it may be a better solution to your problem.
Update:I just found
Bio::Coordinate::Graph too.