If you know the input order then use your inputs to retreive the values 
in the same order later:

a={'a'=>'raj','z'='gopal','b'='hello'}
order = a.keys

#Change the values and mess up the order...

#Output in the same order
order.each { |k| puts k, a[k] }

-- 
Posted via http://www.ruby-forum.com/.