From: Bob Gustafson Date: 2010-04-22T00:37:03+09:00 Subject: Bug? variable changes without assignment I seem to have uncovered a bug. The program below defines a series of variables, named constant, modify, and variable. The constant should remain constant, but instead, it changes - even without an assignment. How does this happen? [root@hoho4 ocr]# cat test.rb constant = '31.12.2006' puts "constant " + constant modify = '40.01' puts "modify " + modify variable = constant 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 40.12.2006 <<<---- Why does this change??? [root@hoho4 ocr]# ruby --version ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux] -- Posted via http://www.ruby-forum.com/.