From: Pete Yandell Date: 2006-03-08T18:37:31+09:00 Subject: Re: ridiculous behavoir of Array#push and Array#clear Changing your code to output the actual arrays: > obj1 = "object1" > obj2 = "object2" > obj3 = "object3" > > arr1 = Array.new > arr2 = Array.new > > arr1 << obj1 > arr1 << obj2 > > arr2 << obj3 > > puts "" > p arr1 > > puts "" > p arr2 > > arr1.push( arr2 ) > puts "" > p arr1 > > arr2.clear > puts "" > > puts "" > p arr2 > > puts "" > p arr1 gives you: > > ["object1", "object2"] > > ["object3"] > > ["object1", "object2", ["object3"]] > > > [] > > ["object1", "object2", []] which should give you a hint as to what's going on. Pete Yandell