in reply to Re: Get Position of Element in an array
in thread Get Position of Element in an array
since this question hasn't been answered yet here a variation for finding the first idx!
%pos= map { $_=>$i++ } reverse @input;
If you need it more than once, then the overhead for building a hash will easily pay off.
Cheers Rolf
|
|---|