The problem is that return %hash doesn't return a hash. It returns a list. Only when you assign that list to something hashy (a hash or an anonymous hash) can you treat it as a hash.
Improve your skills with Modern Perl: the free book.
In reply to Re: Treating sub output as a hash
by chromatic
in thread Treating sub output as a hash
by ISAI student
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |