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/.