You could also take a look at how GFF files are stored in
Bio::DB::GFF or
Bio::DB::SeqFeature::Store which use RDMS to handle these types of range queries (mysql,postgres, sqlite) and an in-memory berkeleydb implementation.
The get_features_by_location is basically what you'd want to use for your problem.