From: jbieger@... Date: 2007-12-25T00:19:59+09:00 Subject: Problem with copying array Hi, I'm a total newbie with Ruby and I was trying to make this function that would get a (multidimensional) array, make a copy, make some changes to the copy and then return the copy, without altering the original array. However, no matter what I try, the original array gets altered. Here is my code: def prune_times (times) # copy = times # copy = Array.new(times) # copy = times.clone copy = times.dup copy.each do |map| map.each do |task| task.replace(best_n(task, 2)) end end return copy end Any help would be greatly appreciated! Jordi