in reply to Hashing multiple items

I wouldn't take up a lot of memory with a giant hash of every possibility if I could avoid it. Would it be possible to have a smaller hash or array of the zone ranges and some if statements to figure out what zone a given coordinate is in when you need it?

my %zones; $zones{B1} = [1,23,7,59]; my @this_coord = (5, 7); my ($x, $y) = @this_coord; while (my ($zone, $rng) = each %zones) { print "Zone is $zone\n" if $$rng[0]<=$x && $$rng[1] >=$x && $$rng[2]<=$y && $$rng[3]>=$y; } __OUTPUT__ Zone is B1