From: Todd Benson Date: 2008-04-10T21:08:39+09:00 Subject: Re: global array of hashes On Thu, Apr 10, 2008 at 6:57 AM, Mario Ruiz wrote: > But not in this case: > > $globvar=Array.new() > myHash=Hash.new() > myHash["oneValue"]="mygenericvalue" > $globvar[0]=myHash > > localvar=$globvar.dup > > localvar[0]["oneValue"]="mylocalvalue" > > puts $globvar In this case, you create a new array that holds the same Hash object. You have to dup the Hash as well. hth, Todd