in reply to Re: Best structure for range find?
in thread Best structure for range find?

Answers are already given but I was driven (tye made me do it :) to add lookup functionality to Net::CIDR::Lite(0.07). There's two ways to look up, looking up a single ip address in a Net::CIDR object, and looking up many ip addresses in several labeled Net::CIDR::Lite objects (kind of like Array::IntSpan, but looking up everything at once is more efficient than looking up one thing at a time since my searches are sequential, i.e. O(n), except for an initial sort which is cached for subsequent searches, and Array::IntSpan is O(log n) (but for small 'n' it doesn't really matter, eh?)).

Array::IntSpan has already been chosen as the 'favoured' answer by the OP (and I tend to agree for his particular needs), but if you ever need IPv6 support...try out Net::CIDR::Lite.