From: Morton Goldberg Date: 2006-08-13T03:00:04+09:00 Subject: Re: Beginner's question: assigning same value to many variables No, that doesn't work. We want each variable initialized to a _different_ empty string. a, b, c, d = Array.new(4) { '' } p [a, b, c, d].collect {|i| i.object_id} #=> [74020, 74010, 74000, 73990] a, b, c, d = Array.new(4,'') p [a, b, c, d].collect {|i| i.object_id} #=> [73920, 73920, 73920, 73920] a, b, c, d = [''] * 4 p [a, b, c, d].collect {|i| i.object_id} #=> [73820, 73820, 73820, 73820] Regards, Morton On Aug 12, 2006, at 1:48 PM, Alexandru E. Ungur wrote: > a, b, c = Array.new(3,'') OR > a, b, c = [''] * 3