perl -e 'use List::Util qw|min|; $pos = 0; @a = qw|95 41 3 9 2|; %hashPos = map {$_=>$pos++} @a; print $hashPos{scalar min @a};' Prints 4