Help for this page

Select Code to Download


  1. or download this
      my $ref = \@list;
    
    ...
      }
    
      # @list is modified in place
    
  2. or download this
      for (my $i = scalar(@list); --$i; ) {
        my $j = int rand ($i+1);
        next if $i == $j;
        @list[$i,$j] = @list[$j,$i];
      }