From: Gavin Sinclair Date: 2003-01-03T12:50:08+09:00 Subject: Re: sort the hash keys On Friday, January 3, 2003, 2:16:29 PM, Mark wrote: > You can also use hash.sort directly, however, be careful. It returns > an array of [key, value]. So to sort and iterate over the hash hash_a > do > hash_a.each { |item| > key = item[0] > value = item[1] > # do stuff ... > } Better: hash_a.each do |key, value| # do stuff end Gavin