I want to be able to determine what zone a zip code falls in from a user input. Once I write the hash, the data contained within it will remain unchanged throughout the script except maybe for the occasional update if things change.
I am just unsure of which approach would be the best or if I have any real choice. I have already written a hash that contains all of the possible zips in this format: %zone = { one => [370,422,490..500,etc.] two => [200..232,388,etc] three => [and so on] four => [and so forth] } I am assuming that I will be able to load an array of each of the zones and test if the zip is is contained within that zone. OR I could list each zip with it's corresponding zone into a hash with each zip and zone paired together, but I think that will take an awful lot of typing. I am wondering which way would be best as far as server load or if the difference would be worth considering. It's much easier for me to use the zone as the name component and a list of integers and ranges of integers for the value component. Is it acceptable to use ranges(this..that,that..this) in the value or name component of a relational array? Being new to this I guess I'm just not sure if my logic is correct. A really good hash tutorial would be of excellent help if anyone can guide me to an online one. Bare in mind that I am a novice. :-) Thanks, Mark > It really depends how YOU need to use %zone. Do you need to find out what > numbers (370, 422, etc.) belong to which zone ("one", etc.)? Or do you > need to know the other way around? > > Do you want to be able to say: > > $zone = $this_hash{$zip}; > > or > > @zips = @{ $this_hash{$zone} }; > > If you want to do both, you could. > > -- > Jeff "japhy" Pinyan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]