it will simply not compile and give you an error message with something like this:

Code

Type of argument to keys on reference must be unblessed hashref or arrayref...

which basically means that the "arrow" notation can be used only with hashref or arrayref, not with plain hashes or plain arrays.

(Another error is that you probably want 'sort keys", not "keys sort" in the foreach line. Not sure either that you really want to sort on the keys, you more probably want to sort on the values, but that's a different issue, it may be your choice to sort the months in alphabetical order if so you wish.)

But if you create a hashref instead of a hash, then "arrow" notation will be useful: