From: Josh Cheek Date: 2011-02-24T16:44:01+09:00 Subject: Re: a, b = Array.new(2).map!{|x| data.dup} --90e6ba475e5deb24e7049d0257f9 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Feb 24, 2011 at 12:11 AM, botp wrote: > On Thu, Feb 24, 2011 at 1:40 PM, Anurag Priyam > wrote: > >> ok, try also something like, > >> > >> a,b,c,d,e =[x.dup]*5 > > > > That will cause a, b, c, d, e to point to the same objects, > > indeed. but they will not point to or clobber x > > Well, then you could just do a = b = c = d = e = x.dup No need for parallel assignment tricks if you are okay with them pointing to the same object. --90e6ba475e5deb24e7049d0257f9--