From: Mike Onofrietto Date: 2012-07-14T15:31:02+09:00 Subject: Re: method clear wiping out other array ? Avdi, Thanks. I'll look into it. To me they should be two separate objects so I would not expect the two names to refer to the same array. In the meantime a did a work-around. I created an empty array "dummy" so arr2=dummy INSTEAD of arr2.clear. It worked very well - solved the problem. Avdi Grimm wrote in post #1068667: > Both variables point to the same array. > > If you want two arrays, you need to call #dup: > > arr2 = arr1.dup > > -- > Avdi Grimm > http://avdi.org -- Posted via http://www.ruby-forum.com/.