From: Me Me Date: 2008-09-18T19:22:23+09:00 Subject: Re: Preserve insert order in a Hash Dick Davies wrote: > On Thu, Sep 18, 2008 at 11:13 AM, Me Me wrote: >>> Hash. >> >> and then print them in the exact order of insertion > > Can't you just sort them on the way out? > i.e. > > sourceinfo.keys.sort.each { |k| > sourceinfo[k].do_stuff > } thanks well in this case they will be sorted alphabetically, right? the example is simplyfied, in my case the keys have differernt names. -- Posted via http://www.ruby-forum.com/.