From: Jon Baer Date: 2006-01-27T04:59:38+09:00 Subject: Subselecting hash back into hash (oneliner?) Going through pick-axe and was just wondering if there was a one liner for something such as this that I may have missed: h2 = Hash.new h1 = {"foo1"=>"bar1", "foo2"=>"bar2"} query = h1.select { |k,v| v == "bar2" } query.each do |result| h2[result[0]] = result[1] end p h2 Thanks. - Jon