Help for this page

Select Code to Download


  1. or download this
    # First, sort @arr1.
    @arr1 = sort {
    ...
    
    # Then recreate @arr2.
    @arr2 = map { s/^.*:::(\d+)$/$1/ } @arr1;
    
  2. or download this
    @arr3 = sort { $a->[1] <=> $b->[1] }
       map { [ $arr1[$_], $arr2[$_] ] }
          (0..$#arr1);
    @arr1 = map { $_->[0] } @arr3;
    @arr2 = map { $_->[1] } @arr3;