in reply to references changing a hash value

$ranimals is a reference to %animals, so they both point at the same thing. So, when you change $$ranimals{'duck'}, you're also changing $animals{'duck'}.