From: Kurt Euler Date: 2002-06-12T06:09:47+09:00 Subject: How to reset a variable to the value in another variable? All- In line 8 in the code below, I want to reset the string variable "content2" with the value in string variable "intro". However, what I'm finding is that line 8 sets up "content2" as some type of pointer to "intro": The content2.gsub commands I'm making in lines 9 through 12 are affecting the value of "intro" as if I were doing "intro.gsub" commands. The solution has got to be simple, but it it illudes me. Your help appreciated! Thanks! -k euler 01 intro = '' 02 File.open("./input/intro_subtemplate.txt") { |f| intro = f.read } 03 04 content = File.new("./input/main_readme_template.txt").read 05 06 IO.foreach("./input/packages.txt") { |x| 07 field = x.chop.split('\t') 08 content2 = intro 09 content2.gsub!(//, intro) 10 content2.gsub!(//, field[2]) 11 content2.gsub!(//, field[1]) 12 content2.gsub!(//, field[3]) 13 File.open("./output/#{field[0]}", "w+") { |file| file.write(content2) } 14 }