From: Joel VanderWerf Date: 2004-03-11T05:46:46+09:00 Subject: Re: saving array Phidippus wrote: > After I do bunch of computations and create a huge array with bunch of > numbers, I like to use the already-computed array in another program > rather than re-computing it each time I run the program. How can I > save the array object in one program and read it from another program > in ruby? You can use marshalling: array = ... File.open("array", "wb") do |f| Marshal.dump(array, f) end To reload: array = nil File.open("array", "r") do |f| array = Marshal.load(f) end