From: w wg Date: 2008-09-27T18:07:51+09:00 Subject: Does array's each-block destroies outer objects ? Hi, Please look: > x = 2840 => 2840 > x.object_id => 5681 > a = [1,2,3,4,5] => [1, 2, 3, 4, 5] > a[4].object_id => 11 > a.each {|x| puts x} 1 2 3 4 5 => [1, 2, 3, 4, 5] >a[4].object_id => 11 > x.object_id => 11 After execute the block , it looks like that ruby destroied the former 'x' object, the 'x' object has object_id 4 now, which is same as a[4].object_id. If so , does it mean that I must choose another variable name in array's each block to keep the 'x' object alive ? Thank you. -- Wwg