in reply to new hash values

Actually, every single one of the above answers fails to duplicate what your code actually does: cause a syntax error. ;-).

You cannot my a hash element. If you leave the my off the hash assignment, then any of the above should work for you.