- or download this
if( exists $copyRef->{ $step } ) {
$copyRef = $copyRef->{ $step };
...
lock %{ $copyRef };
$copyRef = $copyRef->{ $step } = &share( {} );
}
- or download this
lock %{ $copyRef };
$copyRef = $copyRef->{ $step } //= &share( {} )
- or download this
...
my %subhash;
...
lock %mainSharedHash;
$mainSharedHash{ $key } = shared_clone( \%subhash );
...
- or download this
...
my %subhash :shared:
... # populate it
lock %mainSharedHash;
$mainSharedHash{ $key } = \%subhash;