From: jjthrash@... Date: 2001-03-06T23:00:40+09:00 Subject: [ruby-talk:12130] Weird Array behavior Hello, I have the following code: array = [[12345, "val"],[23456, "val2"],[34567, "val3"],[45678,"val4"]] oldArray = array array = Array.new((oldArray.size.to_f/3).ceil, Array.new(2)) oldArray.each_with_index do |entry, index| if array[(index.to_f/3).floor][0] == nil array[(index.to_f/3).floor][0] = entry[0] #INSPECTION POINT array[(index.to_f/3).floor][1] = entry else array[(index.to_f/3).floor][0] |= entry[0] array[(index.to_f/3).floor][1].push(entry) end p array end If I debug and step up to the first time I reach the INSPECTION POINT, I expect the value array to be [[12345, nil], [nil, nil]], but it's actually [[12345, nil], [12345, nil]] This seems to be very wrong, according to what I understand. Can anyone help me out? Thanks in advance, Jimmy PS - the above code is a translated part of a signature tree algorithm I'm implementing, just so you understand why on earth I'd want to do what I was doing. :) -- jjthrash SPAM pobox SPAM com