in reply to Finding the index of a specific element in an array.

Although it doesn't make a lot of sense to discuss Perl solutions when the first comment suggests one that's unlikely to be beaten in efficiency, just for the TIMTOWTDI of it here's another slow one:

$pos = do{ my @h{reverse @a} = (reverse 0..$#a); $h{$elem}};

If it doesn't matter when duplicate elements are found in their last instead of first position, you can omit the reverse.