I don't believe you can make this work. You're defining foo as a hash reference. You'll have to figure out a way to dereference foo without making the parser think you're referring to a variable named %foo and how to avoid creating a new hash reference on every invocation. (I made a lovely infinite loop this way.)
This assumes I even understand what you're trying to do; your example code makes little sense to me. What are you trying to do?
In reply to Re: Dereference a hash constant
by chromatic
in thread Dereference a hash constant
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |