Can't take a reference to a lexical variable? Surely you jest. What happened when you tried it?
He wants a lexical variable because he wants a new hash at the start of each iteration of the loop. Pass that hash as a reference to the gather function (or better yet, just get the hash by having gather() return a reference).
Global variables are bad news, and that's why this thread exists. :)
In reply to Re^4: re-useing a hash
by brian_d_foy
in thread re-useing a hash
by ministry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |