in reply to %hash->{key} is valid syntax?

use diagnostics; reveals the root of the issue:
Using a hash as a reference is deprecated at tmp.pl line 7 (#1)
(D deprecated) You tried to use a hash as a reference, as in %foo->{"bar"} or %$ref->{"hello"}. Versions of perl <= 5.6.1 used to allow this syntax, but shouldn't have. It is now deprecated, and will be removed in a future version.



Code is (almost) always untested.
http://www.justicepoetic.net/