Two problems.
The first problem is the second my. The argument of my needs to be a variable name (not an expression such as %$foo) or a parenthesized list of variable names. Remove the my, and package variable %bar will be populated.
Well, not quite. By using use strict;, you're explicitly telling Perl to disallow you from doing what you want to do. And rightfully so. What you want to do is highly discouraged: Why it's stupid to 'use a variable as a variable name'. Using a Hash of Hash (HoH) would be a better approach. See FunkyMonk's reply to see how that's done.
In reply to Re: Hash references?
by ikegami
in thread Hash references?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |