Help for this page

Select Code to Download


  1. or download this
    lock(%cfg::thash);
    $v1="A";
    $v2="1";
    $cfg::thash{$v1}{$v2} ="b";
    
  2. or download this
    $cfg::thash{$v1}{$v2} ="b";
    
  3. or download this
    ## Make the value of key 'A' an anonymous hash.
    $cfg::thash{A} = {}; 
    
    ## add a key '1' to that anonymous hash with the value "b";
    $cfg::thash{A}{1} = "b";
    
  4. or download this
    use strict;
    use threads;
    ...
    share( $temp );     ## share() the temp var
    $thash{A} = $temp;  ## assign it into the structure
    $thash{A}{1} = 'b'; ## At this point you have what you asked for.