Toon Willems wrote: > On 07 Dec 2009, at 21:35, Ad Ad wrote: > >>> to do. >> >> doesnt require the creation of any sort of a container variable. >> -- >> Posted via http://www.ruby-forum.com/. >> > > A much better way to do this would be to store the city names in a hash. > your code would then be: > > File.open(@file). each do |x| > @hash[x] = true > end Would it not be better to convert to symbols? That is: File.open(@file). each do |x| @hash[x.strip.to_sym] = true end if @hash[:toronto] or if @hash[:"palo alto"] or if @hash[city.to_sym] > > later on you can then just do > > if @hash[city] > > > Toon -- Posted via http://www.ruby-forum.com/.