in reply to hashing intervals

Have a look at Array::IntSpan.