in reply to hash to sub

The parens around %hash are not required in this case, but it is customary to use them.

The parens around shift are necessary, as you can easily prove if you remove them. I believe perl thinks that shift is the name of a variable, instead of the built-in function. Using strict, I get this compile error:

Global symbol "%shift" requires explicit package name at BEGIN not safe after errors--compilation aborted at

diagnostics gives even more info.