Consider the following code:
@person = { :email => '[email protected]' }
temp = @person.clone
temp[:email].upcase!
p temp[:email] # => [email protected]
p @person[:email] # => [email protected], why?!
# But
temp[:email] = '[email protected]'
p @person[:email] # => [email protected]
Ruby version is: "ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]".
I have no idea why is it happening. Can anyone help, please?