in reply to Best structure for range find?

Use a hash; very fast lookups, and you can easily deal with cases in which the IP isn't in your structure. Since you will most likely not be covereing the entire IPv4 address space, you don't need to worry about memory storage concerns.
# assume line is: # ip;ip;ip;.. datum # my %ip_hash; while ( my $line = <FILE> ) { my ( $ip, $datum ) = split /\s*/, $line; my @ip = split /\;/, $ip; foreach my $ipa ( @ip ) { $ip_hash{ $ipa } = $datum; } } # Later.. if ( exists $ip_hash{ $query_ip } ) { do_something_with_datum( $ip_hash{ $query_ip } ); } else { do_not_found_action( $query_ip ); }

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important