in reply to How can I find the index of the biggest element in an array?

You could use the Perl map function in the following way. This achieves the results in just two lines.


%arrayHash=map {$_=> $i++} @array=(5,4,3,2,7); print $arrayHash{pop [sort @array]};

Originally posted as a Categorized Answer.