From: "Jan E." Date: 2012-05-30T22:44:06+09:00 Subject: Re: Problem with duplicated values in writing to an array Hi, Variables are references in Ruby. When you assign the "code" array to the "arr" array, then "arr" will contain this exact array. Not some kind of "snapshot" of the "code" array at this point of time. So what you're actually doing is you assign the same array (referenced by "code") to the first and second index of "arr". If you want to have two independent arrays, you have to clone "code" first. -- Posted via http://www.ruby-forum.com/.