From: Douglas F Shearer Date: 2007-08-21T01:28:22+09:00 Subject: Re: Assignment as a reference? On 20 Aug 2007, at 17:20, Morgan Grubb wrote: > foo = 'bar' #=> bar > foo2 = foo #=> bar > foo.gsub! 'bar', 'wibble' #=> wibble > foo2 #=> wibble What you have experienced is reference assignment. If you wish to duplicate only the content, and not the reference, then you should to use .dup. > foo = "bar" => "bar" > foo2 = foo.dup => "bar" > foo = "wibble" => "wibble" > foo2 => "bar" Hope this helps you out. Douglas F Shearer dougal.s@gmail.com http://douglasfshearer.com