Help for this page

Select Code to Download


  1. or download this
    my @sorted=do{
        my $n;
        my %stuff=map { func($_) . ':' . $n++ => $_ } @unsrt;
        @stuff{sort keys %stuff};
    };
    
  2. or download this
    my @sorted=do{
        my @keys=map func($unsrt[$_]) . ":$_", 0 .. $#unsrt;
        @unsrt[ map +(split /:/)[-1], sort @keys ];
    };
    
  3. or download this
    my @sorted=@unsrt[ map +(split /:/)[-1],
        sort map func($unsrt[$_]) . ":$_", 0 .. $#unsrt ];
    
  4. or download this
    my @sorted=map $unsrt[ (split /:/)[-1] ],
      sort map func($unsrt[$_]) . ":$_", 0 .. $#unsrt;