in reply to Render numeric sequence as array of letters

Try:

my @data= ( 5, 100, 2, 8, 40 ); my @indices= sort { $data[$a] <=> $data[$b] } 0..$#data; my @letters; @letters[@indices]= ('A'..'Z'); print "@letters\n";
so long as you don't have more than 26 numbers.

                - tye
  • Comment on Re: Render numeric sequence as array of letters (index sort + slice)
  • Download Code