How can I marshal a hash with arrays?
- by tuner
What should I do to marshal an hash of arrays?
The following code only prints {}.
s = Hash.new
s.default = Array.new
s[0] << "Tigger"
s[7] << "Ruth"
s[7] << "Puuh"
data = Marshal.dump(s)
ls = Marshal.restore( data )
p ls
If the hash doesn't contain an array it is restored properly.