I want to keep track of the counts of some arbitarily-named strings and then reset the counts to zero. My thought was to do the following:
reset_hash={"string1"=>0,"string2"=>0,"string3"=>0}
=> {"string1"=>0, "string2"=>0, "string3"=>0}
new_hash = reset_hash
=> {"string1"=>0, "string2"=>0, "string3"=>0}
new_hash["string1"]=1
new_hash["string3"]=1
new_hash
=> {"string1"=>1, "string2"=>0, "string3"=>1}
...
Now I want to reset new_hash back to reset_hash:
new_hash = reset_hash
=> {"string1"=>1, "string2"=>0, "string3"=>1}
reset_hash
=> {"string1"=>1, "string2"=>0, "string3"=>1}
What is going on here? It seems that reset_hash has actually been set to new_hash, which is the opposite of what I wanted. How do I implement the desired behavior?