in reply to Hash of Hash of Listed subroutines
The way to dereference a subroutine reference is to use either & slightly differently than you have, or better, to use parentheses so that you can pass arguments to the subroutine. For clarity, I'll switch your outer loop to a while with an each.
while (my ($key, $subs) = each %HoL) { foreach my $sub (@$subs) { $sub->(); # or &$sub; } }
To go back to your example, one problem is that you're looping over the whole hash, where normally you'd want to use keys or values. This works:
for my $key (keys %HoL) { for my $i (@{$HoL{$key}}) { $sub->(); # or &$i; } }
|
|---|