Help for this page

Select Code to Download


  1. or download this
    use threads;
    use threads::shared;
    ...
    $h{test} = $ar;
    
    ## No error this time.
    
  2. or download this
    use threads;
    use threads::shared;
    ...
    my %h : shared;
    my $ar : shared = [];
    $h{test} = $ar;
    
  3. or download this
    use threads;
    use threads::shared;
    my %h : shared;
    my $ar = [];
    $h{test} = share( $ar );
    
  4. or download this
    use threads;
    use threads::shared;
    my %h : shared;
    $h{test} = share( [] );
    Type of arg 1 to threads::shared::share must be one of [$@%] (not sing
    +le ref constructor) at (eval 6) line 1, near "] )"