From: Farrel Lifson Date: 2006-04-20T18:21:03+09:00 Subject: Re: Write Out Then Read In Hash of Two-element Arrays Instead of writing your own de/serialization code why not give Marshal.dump and Marshal.load a try: >> dumped_histHash = Marshal.dump(histHash) => "\004\010{\ni\000[\ai\017i\006i\006[\ai\020i\ai\a[\ai\021i\010i\010[\ai\022i\ ti\t[\ai\023i\n" >> loaded_histHash = Marshal.load(dumped_histHash) => {0=>[10, 1], 1=>[11, 2], 2=>[12, 3], 3=>[13, 4], 4=>[14, 5]} If you need a human readable/editable file consider using YAML: >> require 'yaml' => true >> puts yaml_histHash = histHash.to_yaml --- 0: - 10 - 1 1: - 11 - 2 2: - 12 - 3 3: - 13 - 4 4: - 14 - 5 => nil >> loaded_histHash = YAML.load(yaml_histHash) => {0=>[10, 1], 1=>[11, 2], 2=>[12, 3], 3=>[13, 4], 4=>[14, 5]} Farrel