From: Bil Kleb Date: 2005-09-21T20:51:40+09:00 Subject: [HELP] modifying hash I've got a mental block on refactoring the following, # given a hash of arrays, hash = { 1=>[:a,:b,:c], 2=>[:d,:e], 3=>[:a,:c] } # remove a specified element from the arrays if present hash.each{ |k,v| hash[k] = v.delete_if{|e| e==:a} } => { 1=>[:b,:c], 2=>[:d,:e], 3=>[:c] } Isn't there a simpler way to remove the matching elements? (Maybe my data structure is just lame?) Thanks, -- Bil http://fun3d.larc.nasa.gov