Help for this page

Select Code to Download


  1. or download this
    my @sorted = sort @unsorted;
    
  2. or download this
    my @sorted = sort { $b cmp $a } @unsorted;
    
  3. or download this
    my $nextitem;
    while ($nextitem = pop @rocks) {
        # Use $nextitem
    }
    
  4. or download this
    for (my $i=1; $i <= @rocks; $i++) {
        my $nextitem = $rocks[- $i];    # Take the ${i}th item from the en
    +d
    }