From: Wai-Sun Chia Date: 2002-10-30T16:27:54+09:00 Subject: Sorting HUGE hashes I have a couple of HUGE hashes (~20,000 pairs and growing) that I need to sort. These are in the form of: { "foo"=>["fee","fi"], "bar"=>["fee","fi","fo"], "baz"=>["fee","fi","fo","fum"], : : } I want to be able to sort them in the order of the array size (each of the element has a special variable-sized array. So that I can dump them in another array and indexed in ascending order. sorted_stuff[0] = ["foo", ["fee","fi"]] #array size = 2 sorted_stuff[1] = ["bar", ["fee","fi","fo"]] #array size = 3 sorted_stuff[1] = ["bar", ["fee","fi","fo","fum"]] #array size = 4 What is the scalable way to do this? I'm looking at scaling these hashes beyond 50K... -- Wai-Sun "Squidster" Chia Consulting & Integration Linux/Unix/Web Developer Dude