Help for this page

Select Code to Download


  1. or download this
    # Initialise an array so that $array[n] = n
    my $n = 0;
    foreach (@array) {$_ = $n++}
    
  2. or download this
    @array[0..100] = 0..100;
    
    # or to mimic the behaviour of your code exactly
    @array[0..$#array] = 0..$#array;