File.open("store","w") do |file|
  arr = [ ]
  Marshal.dump(arr,file,0)      #    in `dump': exceed depth limit
                                # (ArgumentError)
  Marshal.dump(arr,file,1)
  arr = [1, 2, 3]
  Marshal.dump(arr,file,1)      # in `dump': exceed depth limit
                                # (ArgumentError)
  Marshal.dump(arr,file,2)
  arr = [1, [2], 3]
  Marshal.dump(arr,file,2)      # in `dump': exceed depth limit
                                # (ArgumentError)
  Marshal.dump(arr,file,3)
end

File.open("store") do |file|
  p Marshal.load(file)           #  []
  p Marshal.load(file)           #   [1, 2, 3]
  p Marshal.load(file)           #   arr = [1, [2], 3]
end

