[perl] How to use foreach with a hash reference?