Help for this page

Select Code to Download


  1. or download this
    my @b = map { $_->[1] }
                sort { $b->[0] <=> $a->[0] }
                map { [ $a[ $_ ]->{total}, $_ ] } 0..$#a;
    
  2. or download this
    $a[0]->{total} = 0;
    $a[1]->{total} = 10;
    ...
         map { [ $a[$_]->{total}, $_ ] } 1..$#a;
    
    print "$b[$_] = $a[$b[$_]]->{total}\n" for 0..$#b;