Help for this page

Select Code to Download


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