Help for this page

Select Code to Download


  1. or download this
    my $var :shared;
    $var = 1;              # ok
    $var = [];             # error
    $var = &share([]);     # ok
    
  2. or download this
    my %hash :shared = ( ... );
    $DataQueue->enqueue(\%hash);
    
  3. or download this
    # Fixed as per BrowserUK's reply.
    # Initialization must be done after share.
    my $href = share({});
    %$href = ( ... );
    $DataQueue->enqueue($href);
    
  4. or download this
    use Storable qw( freeze thaw );
    my %hash = ( ... );
    $DataQueue->enqueue(freeze(\%hash));