The issue is that the => expression in the {} cause the interpreter to read the whole expression as a hash-ref rather than a code block, either of the suggested fixes will make the compiler do the right thing.
-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."