From: Joseph Divelbiss Date: 2005-12-31T13:06:18+09:00 Subject: Re: Another Newb asks questions. Thanks again all.. so that you know your efforts wern't in vain I think I learned a thing or two. The rough code (still needing debugging about as much as I need sleep) is below. I have a high level of confidence that I will find the typo or missing end to make it work when I wake up in the morning. require 'enumerator' if Dir["#{$script_dir}data/"].last != nil script_data_dir = "#{$script_dir}data/" end build_hash = Proc.new do |type| type_hash = Hash.new file.open("#{script_data_dir}#{type}.dat", "r") do |file| file.each_slice(2) do |key, value| type_hash[key.chomp] = value.chomp end end $type_hash = type_hash end data_files=Dir["#{script_data_dir}*.dat"] data_files.each do |name_of_file| build_hash.call(file.basename(name_of_file, '*.*')) end VR, Joseph -- Posted via http://www.ruby-forum.com/.