# thread::shared only allws a single level of shared structure
# needs a explicit hash creation for nested data structures
my %counts : shared = ();
foreach my $state (%known_states) {
# COUNTS
unless (exists $counts{build}) {
my %cb : shared;
$counts{build} = \%cb;
}
$counts{build}{$state} = 0;
}
Right now, I have to do something like the above where I have to explicitly create a hash reference for each sub-level hash.
Is there a better way of doing it?
P.S. if I don't create a hash ref then I get an "Invalid value for shared scalar" error since I am trying to use it as a hash.