You need to write $subhash->{$key} and not $subhash{$key} because you need to dereference the scalar $subhash, not access %subhash. (As I note in my update, strict.pm catches this kind of bug for you.)
If this fix confuses you, then I'd highly recommend reading references quick reference.
In reply to Re: Re: Re: HoH and accumulation
by tilly
in thread HoH and accumulation
by djbiv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |