James Edward Gray II wrote: > On Oct 11, 2005, at 3:16 PM, ES wrote: > > > def map_from(file) > > Hash[*File.readlines(file).map {|line| line.split '='}.flatten] > > end > > Pretty much the same thing, but this should allow you to leave of > some strips later, I hope: > > def hash_from_file( file_name ) > Hash[*File.read(file_name).split("\n").map { |line| line.split > ("=") }.flatten] > end > > James Edward Gray II Erm, what do you mean "to leave of some strips"? The only difference I can see is readlines(file) -> read(file_name).split("\n"), and I'm not sure what the difference is.