From: Bob Gustafson Date: 2010-04-22T02:12:09+09:00 Subject: Re: Bug? variable changes without assignment Jes炭s Gabriel y Gal叩n wrote: > > variable = constant.dup > OK, got it. I modified my program and I get what I want now. Thanks much. [root@hoho4 ocr]# cat test.rb constant = '31.12.2006' puts "constant " + constant modify = '40.01' puts "modify " + modify variable = constant.dup <<<---- Added the .dup puts "variable " + variable puts "constant " + constant variable[0..1] = modify[0..1] puts "variable " + variable puts "constant " + constant [root@hoho4 ocr]# ruby test.rb constant 31.12.2006 modify 40.01 variable 31.12.2006 constant 31.12.2006 variable 40.12.2006 constant 31.12.2006 <<--- OK, it stays 'constant' [root@hoho4 ocr]# -- Posted via http://www.ruby-forum.com/.