Help for this page

Select Code to Download


  1. or download this
    die if @ref / 3;
    
  2. or download this
    my %out = map  { $ref[$_] => [ @ref[$_+1..$_+2] ] }
              grep { not $_ % 3 }
              0 .. $#ref;
    
  3. or download this
    for @ref -> $key, $val1, $val2 {
        %out{$key} = [ $val1, $val2 ];
    }
    
  4. or download this
    my %out = map -> $k, $v, $w {
        $k => [ $v, $w ];
    }, @ref;